Post

Replies

Boosts

Views

Activity

Reply to On iOS 13.1, CNCopyCurrentNetworkInfo occasionally doesn't work.
@eskimo as of 2022-02-25, we came across this thread from another article saying calling CNCopyCurrentNetworkInfo will lead to massive memory leak, with Xcode 13.2.1, iOS 14, while the app has no location auth and call this API. It will return NULL, and lots of internal objects leak, please see attached screenshot. our test code: for (int i = 0; i < 100000; i++) { @autoreleasepool { NSString *ssid = [UIDevice currentWifiSSID]; NSString *bssid = [UIDevice currentWifiBSSID]; } } currentWifiBSSID will be like: NSArray *interfaces = (__bridge_transfer NSArray *)CNCopySupportedInterfaces(); NSString *ssidStr = nil; for (NSString *name in interfaces) { NSDictionary *networkInfo = (__bridge_transfer NSDictionary *)CNCopyCurrentNetworkInfo((__bridge CFStringRef)name); ssidStr = [networkInfo objectForKey:(__bridge NSString *)kCNNetworkInfoKeySSID]; if([ssidStr isKindOfClass:[NSString class]] && ssidStr.length > 0) { return ssidStr.copy; } } return nil; } Any plan to fix CNCopyCurrentNetworkInfo?
Feb ’22
Reply to On iOS 13.1, CNCopyCurrentNetworkInfo occasionally doesn't work.
@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
Mar ’22
Reply to [Need help ASAP] UIKit - TabbarController - Tabbar is behind selected VC's view with Xcode16 RC + iOS18 RC combo, but the rest combo are just fine
Not really at this moment, I'm trying to isolate the issue but not still no clue. I'm guessing the reason is that the legacy code tried to tweak the tab bar controller's view. I see code that added views into tab bar VC's view, after remove it will work fine, but our logic is dead then, so not an option to me. I had an idea to how to create the demo project but that would cost me some time and the top priority for me is to fix our code rather than creating a demo and find the root cause. I have filed a code level support for this, and will post the result if it's our side issue.
Topic: UI Frameworks SubTopic: UIKit
Sep ’24