当iPhone连接到wifi时,AFNetworkingReachabilityManager在app启动时离线(AFNetworkingReachabilityManager offline at app start when iPhone is connected to wifi)
这个:
[AFNetworkReachabilityManager sharedManager].reachable当我的应用程序开始时返回NO ...
[[AFNetworkReachabilityManager sharedManager] startMonitoring]; 被称为 [[AFNetworkReachabilityManager sharedManager] stopMonitoring]; 没有被称为 我已连接到wifi 我正在使用iPhone(不是模拟器)这怎么可能??
This:
[AFNetworkReachabilityManager sharedManager].reachablereturns NO at the start of my app when...
[[AFNetworkReachabilityManager sharedManager] startMonitoring]; has been called [[AFNetworkReachabilityManager sharedManager] stopMonitoring]; has not been called I'm connected to wifi I'm using the iPhone (not simulator)How is this possible??
最满意答案
AFNetworkReachabilityManager异步方式实现它的魔力。 在调用startMonitoring之后的某个时间,reachable的值无效。 获取该信息的最佳方法是通过setReachabilityStatusChangeBlock:
AFNetworkReachabilityManager does it's magic asynchronously. The value of reachable is not valid until some time after startMonitoring is called. The best way to get that information is via setReachabilityStatusChangeBlock:
更多推荐
sharedManager,AFNetworkReachabilityManager,iPhone,wifi,reachable,电脑培训,计算机培训,IT培训
发布评论