开发者

iPhone App : Wireless connection fails after sleep

I have a problem with 开发者_如何学运维a new app I am writing. The app connects to the internet to download an xml file which it uses in the app. It goes back regularly to sync the data - basically to check if it has changed. This all works fine but I am experiencing a problem if the iPhone has gone to sleep. When it wakes up 9 times out of 10 the wireless connection fails. If the iPhone is connected to a 3G network (i.e. not through a wireless router) it is fine. Has anyone experienced this problem or have any ideas on how to overcome it?

I am using the NSURLConnection methods to download the data if that makes a difference.


Apple requires before attempting any kind of network connection, that you check for network availability (for instance using the Reachability class methods) and, if the net is not available, you should avoid trying the connection and instead you should alert the user.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜