iOS 获取Wifi的SSID及MAC地址
2015-08-13 14:58
525 查看
导入系统头文件
#import <SystemConfiguration/CaptiveNetwork.h>
实现代码
NSString *ssid = @"Not Found";
NSString *macIp = @"Not Found";
CFArrayRefmyArray = CNCopySupportedInterfaces();
if (myArray != nil) {
CFDictionaryRefmyDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
if (myDict != nil) {
NSDictionary *dict = (NSDictionary *)CFBridgingRelease(myDict);
ssid = [dict valueForKey:@"SSID"];
macIp = [dict valueForKey:@"BSSID"];
}
}
UIAlertView *av = [[UIAlertView alloc] initWithTitle:ssid message:macIp delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
[av show];
相关文章推荐
- ios即时通讯客户端开发之-mac上搭建openfire服务器
- IOS开发之----NSDictionary,JSON和XML互相转换
- iOS8扩展插件Extension的开发
- ios接入facebook及集成plugin-x
- iOS中关于登录验证方面的问题的解决
- [iOS]字符串转字典
- 【转】iOS调试技巧
- iOS第三方支付-支付宝支付
- 4000 获取键盘的高度变化
- IOS 将毫秒数转换为年月日时分秒的时间
- 关于iOS中的懒加载
- iOS 集合的深复制与浅复制
- iOS利用Runtime自定义控制器POP手势动画(经典)
- iOS 之GCD串行和并发队列的理解
- iOS学习过程中遇到的一些有用的小功能(8/13更新)
- iostream.h和iostream 区别
- 一个phonegap门外汉的phonegap初体验
- 一个phonegap门外汉的phonegap初体验
- ios x264编译问题 No working C compiler found
- IOS下Category添加属性字段