SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, hostAddress);
Reachability* returnValue =NULL;
if(reachability !=NULL)
{
returnValue = [[selfalloc]init];
if(returnValue !=NULL)
{
returnValue->_reachabilityRef= reachability;
}
else{
CFRelease(reachability);
}
}
returnreturnValue;
https://developer.apple.com/library/archive/samplecode/Reachability/Introduction/Intro.html
网友评论