有时候需要获取iphone设备SSID信息。
ARC:
- (NSString *)getSSID {
NSArray *networkInfos = (__bridge_transfer id)CNCopySupportedInterfaces();
for (NSString *ifnam in networkInfos) {
id info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
if (info && [info count])
{
NSDictionary *dic = (NSDictionary *)info;
return [dic valueForKey:@"SSID"];
}
}
return nil;
}