开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜