iOS中如何判断是否有网络
来源:互联网 发布:知商金融官网 编辑:程序博客网 时间:2024/06/02 10:29
Reachability 官方下载链接:http://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html
在要调用的类里面使用:
<!--StartFragment -->
-(BOOL)testConnection{
BOOLresult=YES;
// 因此可以这样检查网络状态:
Reachability*r = [Reachability reachabilityWithHostName:@"www.hao123.com"];
switch ([rcurrentReachabilityStatus]) {
caseNotReachable:
NSLog(@"没有网络连接");
// 没有网络连接
break;
caseReachableViaWWAN:
NSLog(@"使用3G网络");
// 使用3G网络
break;
caseReachableViaWiFi:
NSLog(@"使用WiFi网络");
// 使用WiFi网络
break;
} return result;
}- iOS中如何判断是否有网络
- iOS判断是否有网络
- 如何判断是否有网络
- android 开发中如何判断是否有网络连接
- IOS中如何判断当前网络状态是否可用
- IOS之判断是否有网络
- iOS判断当前是否有网络
- iOS判断当前是否有网络
- iOS判断当前是否有网络
- iOS--判断当前是否有网络
- iOS判断当前是否有网络
- ios 判断字符串中是否有中文
- iOS 判断字符串中是否有中文
- 判断是否有网络
- 判断是否有网络
- 判断是否有网络
- 如何判断字符串中是否有中文
- iOS中判断网络是否联网
- (转)Consuming Web Services in Oracle
- hibernate外键对应设置
- 你猜它是个什么点
- Linux 创建 Oracle 11g r2 asm磁盘出错
- 黑马程序员_Java中的多线程(线程的生命周期)
- iOS中如何判断是否有网络
- android 属性系统
- 还有这样的形状
- 盘点2012年十大神优化与渣优化游戏
- PHP学习 新闻系统 js编辑框的制作 添加新闻操作
- cdecl、stdcall、fastcall函数调用约定区别
- Fixing "There was a problem with the editor 'vi'" for Git on Mac OS X
- 这个是空心三角吧
- asp.net mvc(模式)和三层架构(BLL、DAL、Model)的联系与区别