iphone - Reachability Guide for iOS -


has found halfway decent guide implementing reachability on ios?

i have implemented reachability this. download https://developer.apple.com/library/content/samplecode/reachability/introduction/intro.html , add reachability.h , .m project. add systemconfiguration framework project. #import "reachability.h" want use it. use code.

-(bool)reachable {     reachability *r = [reachability reachabilitywithhostname:@"enbr.co.cc"];     networkstatus internetstatus = [r currentreachabilitystatus];     if(internetstatus == notreachable) {         return no;     }     return yes; } 

when want check reachability...

if ([self reachable]) {     nslog(@"reachable"); } else {     nslog(@"not reachable"); } 

here example project made. http://dl.dropbox.com/u/3656129/reachabilityexample.zip


Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -