导入头文件
#import <SystemConfiguration/CaptiveNetwork.h>
- (void)printSSIDInfo { NSArray *interfaces = CFBridgingRelease(CNCopySupportedInterfaces()); for (NSString *interface in interfaces) { NSDictionary *ssid = CFBridgingRelease(CNCopyCurrentNetworkInfo((__bridge CFStringRef)interface)); NSLog(@"%@", ssid); } }
2015-02-27 14:53:53.537 TestProject[206:60b] { BSSID = "c0:7b:bc:7a:fb:ca"; SSID = GuestAP; SSIDDATA = <47756573 74323031 35>; }
原文地址:http://blog.csdn.net/chadeltu/article/details/43968889