3
我正在使用CNCopySupportedInterfaces()获取bssid并且它不返回任何值。不知道为什么。CNCopySupportedInterfaces()虽然无线连接返回没有值
我的代码如下所示:
#import <SystemConfiguration/CaptiveNetwork.h>
CFArrayRef myArray = CNCopySupportedInterfaces();
CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
NSLog(@"Connected at:%@",myDict);
NSDictionary *myDictionary = (__bridge_transfer NSDictionary*)myDict;
NSString * BSSID = [myDictionary objectForKey:@"BSSID"];
NSLog(@"bssid is %@",BSSID);
的NSLog(@ “%@”,CNCopySupportedInterfaces());
回报(null)
不知道哪里出了什么问题?需要一些指导
Works在我的iOS 6和iOS 7(beta)设备上为我找到。不在模拟器中。 – Henning 2013-09-06 18:01:40
dun使用模拟器。这需要使用设备。 – lakesh 2013-09-07 10:46:35
我使用iPhone 5S操作系统7.1它不工作, CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray,0))返回null – vualoaithu 2014-04-17 08:05:08