Network reachability on iPhone
问题 Maybe is there a good way to determine if I have an internet connection or not? (3G or wifi) Thanks! 回答1: Here's something a new search engine called Google revealed: iPhone SDK: Testing Network Reachability 回答2: See SCNetworkReachabilityRef datatype in the SystemConfigration framework. It does not test the network per se, it's a framework around ping. 来源: https://stackoverflow.com/questions/2401987/network-reachability-on-iphone