问题描述
我在iPhone4上使用iOS4.1。我也在使用最新版本的Reachability代码。我的设备没有连接,但似乎代码等待超时,否则设备需要很长时间才能报告可达性状态。
I'm using iOS4.1 on an iPhone4. I'm also using the latest version of the Reachability code. My device doesn't have a connection but it seems like the code waits to timeout or else the device takes ages to report back about the reachability status.
这似乎不会发生在使用iPhone3gs的iOS4.0.1上。
this doesn't seem to happen on iOS4.0.1 using iPhone3gs.
有没有其他人遇到这个?除了开始一个新线程之外,有什么方法可以绕过它吗?
Has anyone else come across this? Any way to get around it other than starting a new thread?
推荐答案
你确定你是异步使用它吗?
Are you sure you're using it asynchronously?
来自Apple的文档ReadMe.txt on Reachability项目:
From Apple's docs ReadMe.txt on the Reachability project:
所以,我认为你是对的 - 开始一个后台线程来处理它。
So, I think you're right - start a background thread to handle it.
这篇关于Reachability示例代码中的SCNetworkReachabilityGetFlags需要很长时间才能返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!