iPhone操作系统:如何以编程方式将iPad 3G与iPad Wi-Fi区分开来? [英] iPhones OS: how to programmatically differentiate iPad 3G from iPad Wi-Fi?

查看:108
本文介绍了iPhone操作系统:如何以编程方式将iPad 3G与iPad Wi-Fi区分开来?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iPhone OS中是否有任何属性或其他机制可以在运行时检查应用程序是否在iPad 3G或iPad Wi-Fi上运行?
似乎UIDevice类没有提供类似的东西。

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 anything like that.

我的应用程序正在广泛使用互联网访问,我想明确警告用户,在3G延迟或可以预期额外的成本,甚至禁止在iPad 3G上使用一些花哨的弹出窗口运行应用程序。

My application is using internet access extensively and I would like to explicitly warn user that on 3G delays or additional costs can be expected OR even ban application from running on iPad 3G with some fancy popup.

推荐答案

我认为除了3G以外网络功能,没有必要有所作为。使用Apple提供的Reachability.h类,您可以检查互联网连接是否可用以及是否为移动网络或无线网络。

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.

示例代码:
< a href =http://developer.apple.com/iphone/library/samplecode/Reachability/Introduction/Intro.html =nofollow noreferrer> http://developer.apple.com/iphone/library/samplecode /Reachability/Introduction/Intro.html

Reachability类提供以下值:

The Reachability class provides the following values:

ReachableViaCarrierDataNetwork ReachableViaWiFiNetwork NotReachable

这篇关于iPhone操作系统:如何以编程方式将iPad 3G与iPad Wi-Fi区分开来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆