我正在尝试连接3g网络,但scnetwork可达性不能正常工作...... 它在wifi上工作正常但在3g或边缘上出错
这是代码......
SCNetworkReachabilityContext context = { 0, &g_con, NULL, NULL, NULL };
SCNetworkReachability *reachability = SCNetworkReachabilityCreateWithName( NULL, "www.google.com" );
if( ! reachability )
return;
if( ! SCNetworkReachabilitySetCallback( reachability, reachabilityCallback, &context ) )
return;
SCNetworkReachabilityScheduleWithRunLoop( reachability, CFRunLoopGetMain(), kCFRunLoopDefaultMode );