如何针对信号丢失或站点关闭实施代码?
在我的应用程序中,我使用网络服务。我已经使用 Reachability 类实现了网络可达性。但只有当我开始我的应用程序时才会检查。
请注意,在下载数据时,如果发生信号丢失或站点关闭,我想显示警报窗口。
这可以通过使用 Reachability 类来完成吗?如果是,那么如何实施?如果不是,那么其他实施方式是什么?
提前致谢。
In my app I am using webservices. I have implemented the Network Reachability using Reachability class. But that checks only when i start my application.
Note that, while downloading the data if loss of signal or site down occurs, I want to show the alert window.
Can this be done with the use of Reachability class? If yes than how to implement this? If no than what is the other way to implement ?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,您可以在
NSNotificationCenter
的帮助下完成此操作Yes you can do this with help of
NSNotificationCenter
是的,这是可以做到的。一旦您注册以获取状态,任何更改都会触发回调。相应地处理它。
Yes it can be done. Once you register to get the status any change will hit the callback. Handle it accordingly.