标签:
- (NSString *)fetchSSIDInfo
{
NSString *ssid = nil;
NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
for (NSString *ifnam in ifs) {
NSDictionary *info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
if (info[@"SSID"]) {
ssid = info[@"SSID"];
}
}
return ssid;
}
注意:真机才好使, 模拟器 获取到的 是空的。
标签:
原文地址:http://www.cnblogs.com/ceasar/p/5072238.html