【发布时间】:2013-02-07 18:02:00
【问题描述】:
我正在使用更新的Reachability 库来测试是否可以访问互联网连接。我尝试记录一条消息以防互联网无法访问,但日志没有调试:
//Test the internet connection
Reachability* reach = [Reachability reachabilityForInternetConnection];
reach.unreachableBlock = ^(Reachability*reach)
{
NSLog(@"Internet connexion unreachable");//Although Internet cnx is off, this message is not displayed
return;
};
// start the notifier which will cause the reachability object to retain itself!
[reach startNotifier];
我是否误解了可达性库?互联网关闭时如何执行给定任务?谢谢。
P.S:我的iPad只有wifi,没有3G服务。
【问题讨论】:
标签: ios reachability