我想要一个应用程序是在IOS中完成。当网络丢失时,应用程序必须向用户发出通知。是否可以使用Objective C检查网络状态?这是不是有很多工作?
我是ios开发的新手,编写代码的人说这需要几个小时才能写完。
此外,我想为ios电子名片共享脚本。开发人员表示需要5天时间才能完成任务。
有人能在这方面帮我吗?我厌倦了听到他身边的许多借口,无法继续下去。
谢谢
发布于 2015-02-18 17:47:44
If you want to check reachability before some code execution you should just use..You can use reachability class for checking network status..
Reachability *reachability = [Reachability reachabilityForInternetConnection];
NetworkStatus internetStatus = [reachability currentReachabilityStatus];
if (internetStatus != NotReachable) {
//my web-dependent code
}
else {
//there-is-no-connection warning
}
You can also add a reachability observer somewhere (i.e. in viewDidLoad):
Reachability *reachabilityInfo;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(myReachabilityDidChangedMethod)
name:kReachabilityChangedNotification
object:reachabilityInfo];https://stackoverflow.com/questions/28576233
复制相似问题