SCNetworkReachabilityFlags flags; 
    BOOL receivedFlags; 
 
    SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(CFAllocatorGetDefault(), [@"google.com" UTF8String]); 
    receivedFlags = SCNetworkReachabilityGetFlags(reachability, &flags); 
    CFRelease(reachability); 
 
    //NSLog(@"idiotic flags %@", receivedFlags); 
 
    if (!receivedFlags || (flags == 0)) 
    { 
        return NO; 
    } else { 
        return YES; 
    }

发布评论

分享到:

IT虾米网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!

iOS从远程地址获取图片并修改尺寸详解
你是第一个吃螃蟹的人
发表评论

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。