iPhones OS: how to programmatically differentiate iPad 3G from iPad Wi-Fi?

前端 未结 2 1608
南方客
南方客 2021-02-14 11:28

Is there any property or other mechanism in iPhone OS to check during runtime whether application is running on iPad 3G or iPad Wi-Fi? Seems like UIDevice class does not provide

2条回答
  •  终归单人心
    2021-02-14 11:47

    I assume that other than 3G networking capabilities, there is no need to make a difference. Using Reachability.h class provided by Apple you can check if internet connection is available and if it is Mobile network or Wireless network.

    Sample code here: http://developer.apple.com/iphone/library/samplecode/Reachability/Introduction/Intro.html

    The Reachability class provides the following values:

    ReachableViaCarrierDataNetwork, ReachableViaWiFiNetwork or NotReachable.

提交回复
热议问题