iphone SDK检测Wifi和运营商网络 [英] iphone SDK detect Wifi and Carrier network

查看:195
本文介绍了iphone SDK检测Wifi和运营商网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序访问互联网,我只想通过wifi或运营商数据网络检测是否存在连接

my app accesses the internet and i just want to detect whether there is a connection either via wifi or via carrier data network or not

apple已经为可达性

apple has made an example for that "Reachability"

https://developer.apple.com/iphone/library/samplecode/Reachability/

我认为它只是检测到wifi而不是运营商网络

i think it just detects the wifi and not the carrier network

任何人都可以告诉我,最好是检测是否存在连接(任何类型的连接)

can anyone tell me, whats the best to be done to detect if there's a connection ( any type of connection )

感谢你的帮助!

推荐答案

这个样本正是你所需要的。

That sample is exactly what you need.

看看Reachability.m。它会告诉你是否有任何联系,然后告诉你你有什么样的联系。

Look at Reachability.m. it'll tell you whether you have any connection, and then tell you what kind of connection you have.

这篇关于iphone SDK检测Wifi和运营商网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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