tony million Reachability says unreachable when connected

后端 未结 1 1526
温柔的废话
温柔的废话 2021-02-20 14:57

I have searched but have not found an issue like mine. I\'m sure it\'s something I have over looked .

I am using tony million\'s reachability block method. it is worki

相关标签:
1条回答
  • 2021-02-20 15:22

    This is what I did on my end and got the job done for me. I try using the blocks but it seems it was more trouble that solving my issue. Hope this helps.

    Reachability *reach = [Reachability reachabilityWithHostname:@"www.jportdev.com"];
    if ([reach isReachable]){
        // Reachable
        //NSLog(@"is reachable.......");
    }else{
        // not Reachable
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Network is unavaliable!" message:@"Some content in this application might not be avaliable without network connectivity." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [alert show];
        alert = nil;
    }
    
    0 讨论(0)
提交回复
热议问题