views:

25

answers:

1

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.

A: 

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.

unforgiven
Ok thanks for the tip. I am new to this so I will look into that :-)