@eskimo
is fetchCurrentWithCompletionHandler synchronous or aysnchronous in terms of the completion handler? e.g. Our code base using CNCopyCurrentNetworkInfo is synchronous, but if fetchCurrentWithCompletionHandler is aysnchronous for the completion handler, our code base might have a problem.
And in terms of mem leak, thew shiny new API is still proposing leaking, I only write a simple for loop with a pool:
for (int i = 0; i < 100000; i++) {
@autoreleasepool {
[NEHotspotNetwork fetchCurrentWithCompletionHandler:^(NEHotspotNetwork * _Nullable currentNetwork) {
NSString *ssid = currentNetwork.SSID;
NSString *bssid = currentNetwork.BSSID;
NSString *network = [[NSString alloc] initWithFormat:@"%@,%@", ssid, bssid];
}];
}
}
I'm not sure if it's real leaks. I filed both API with bug number 9936268: https://feedbackassistant.apple.com/feedback/9936268
