I am trying to use the SOLStumbler from here: Accessing & Using the MobileWiFi.framework to scan for wifi networks. I am aware that this is not supported by apple but it is for educational purposes and experiments. I add the following files to my application and it compiles fine but it always exits with an error code. (As part of the ".m" file.) Does anyone know how to get this working?
This part of SOLStumbler.m always outputs a single letter error. Normally e
but sometimes u
.
libHandle = dlopen("/System/Library/SystemConfiguration/WiFiManager.bundle/WiFiManager", RTLD_LAZY);
char *error;
if (libHandle == NULL && (error = dlerror()) != NULL) {
NSLog(@"%c",error);
exit(1);
}
My ViewController code:
#import "SOLStumbler.h"
-(void)viewDidLoad{
SOLStumbler *networksManager = [[SOLStumbler alloc] init];
[networksManager scanNetworks];
NSLog(@"%@", [networksManager description]);
[networksManager release];
}