Posted By

357_gaby on 05/18/09


Tagged

iphone


Versions (?)

Who likes this?

10 people have marked this snippet as a favorite

alladinian
hERB
charter
umang_nine
sb
nsbuckner
saturngod
Tintenklecks
gospaz
AndreyZarembo


Check Internet Connection (Alternative)


 / Published in: Objective C
 

taken from the web, somewhere

  1. SCNetworkReachabilityFlags flags;
  2. BOOL receivedFlags;
  3.  
  4. SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(CFAllocatorGetDefault(), [@"google.com" UTF8String]);
  5. receivedFlags = SCNetworkReachabilityGetFlags(reachability, &flags);
  6. CFRelease(reachability);
  7.  
  8. //NSLog(@"idiotic flags %@", receivedFlags);
  9.  
  10. if (!receivedFlags || (flags == 0))
  11. {
  12. return NO;
  13. } else {
  14. return YES;
  15. }

Report this snippet  

You need to login to post a comment.