AFNetworking 2 有什么方法可以等效
[Reachability reachabilityForLocalWiFi];
Best Answer-推荐答案 strong>
我查看了 Apple 可访问性代码,我认为这可以完成这项工作。
- (AFNetworkReachabilityManager*) reachabilityForLocalWifi
{
struct sockaddr_in localWifiAddress;
bzero(&localWifiAddress, sizeof(localWifiAddress));
localWifiAddress.sin_len = sizeof(localWifiAddress);
localWifiAddress.sin_family = AF_INET;
// IN_LINKLOCALNETNUM is defined in <netinet/in.h> as 169.254.0.0.
localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM);
return [AFNetworkReachabilityManager managerForAddress:&localWifiAddress];
}
关于ios - AFNetworking 可达性ForLocalWiFi,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/21684413/
|