Reachability not working as expected

前端 未结 6 910
不思量自难忘°
不思量自难忘° 2021-02-19 02:53

Downloaded Reachability from Apple, using this method to check for an active connection:

-(BOOL)isReachable{

    Reachability *r = [Reachability reachabilityWit         


        
6条回答
  •  误落风尘
    2021-02-19 03:24

    EDITED: you should remove the protocol, http from your reachabilityWithHostName call, so updated it to

     Reachability *reachability = [Reachability reachabilityWithHostname:@"www.google.com"];
     NetworkStatus netStatus = [reachability currentReachabilityStatus];
    

提交回复
热议问题