How to tell iPhone NSURLConnection to abort
Posted
by
Jahmic
on Stack Overflow
See other posts from Stack Overflow
or by Jahmic
Published on 2011-02-23T06:35:25Z
Indexed on
2011/02/24
7:25 UTC
Read the original article
Hit count: 211
I have an app that makes moderate use of NSURLConnection. These async calls eventually finish and release properly (it looks like), but sometimes it takes some time for them to finish.
So, there are times when I exit the app, (note, not just sending it the background), that some of these connections are still active. If I immediately restart the app, the app freezes on startup. (didFinishLaunchingWithOptions never seems to get called).
While I'm not certain these connections are the issue, it would probably be good to terminate or cancel any remaining. Any suggestions on how to do this?
Bonus points on how to debug the restart also. (I'm already saving NSLog statements to a downloadable file)
© Stack Overflow or respective owner