#import <SystemConfiguration/CaptiveNetwork.h>

 

#pragma mark - 获取当前连接wifi信息
- (NSString *)returnWifiName
{
    NSString *wifiName = @"Not Found";
    
    CFArrayRef myArray = CNCopySupportedInterfaces();
    
    if (myArray != nil) {
        CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
        if (myDict != nil) {
            NSDictionary *dict = (NSDictionary*)CFBridgingRelease(myDict);
            
            wifiName = [dict valueForKey:@"SSID"];}
    }

    MyLog(@".....");
    return wifiName;
}

 

posted on 2014-08-13 16:01  ZiCheng  阅读(535)  评论(0编辑  收藏  举报