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];
精彩评论