当iPhone连接到wifi时,AFNetworkingReachabilityManager在app启动时离线(AFNetworkingReachabilityManager offline at

系统教程 行业动态 更新时间:2024-06-14 17:01:31
当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].reachable

returns 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培训

本文发布于:2023-04-20 16:11:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/ffc91aad3b308a723158188008c7711c.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:离线   连接到   启动时   AFNetworkingReachabilityManager   wifi

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!