开发者

How do you display a Alert when not connected to the internet ? iOS

开发者 https://www.devze.com 2023-01-20 03:16 出处:网络
hi How do you display a Alert when not connected to the internet ? iOS not connected to internet means has no wifi , no connection to remote host ( www.google.com)

hi How do you display a Alert when not connected to the internet ? iOS

not connected to internet means has no wifi , no connection to remote host ( www.google.com)

no Cellular Data Network

as 开发者_Go百科i have seen many applications showing this message when i am not connected to the internet.

i have tried downloading the Reachability from apple dev resources however it does not give me what i want of implementing the codes into my .h .m file.

hope to get a reply.


Code to do this is here.

http://developer.apple.com/library/ios/samplecode/Reachability/

You can call:

    self.remoteHostStatus           = [[Reachability sharedReachability] remoteHostStatus];
    self.internetConnectionStatus   = [[Reachability sharedReachability] internetConnectionStatus];
    self.localWiFiConnectionStatus  = [[Reachability sharedReachability] localWiFiConnectionStatus];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号