nsurlconnectiondelegate - What if app sleeping or dead before NSURLConnection asynchronous request comes back? -


If an app is dead, dies, sleeps or is in the process of getting out when NSURL connection accepts requests Is the bench?

It seems that I keep at least one flag which says "the program is coming out" before my ASCNC function, it assumes that the program data is valid.

Thank you.

In iOS 4.0 and above, when the user closes the app, Is put in. Until you tell it otherwise, the representative callback will not work until the user opens the app again. You can test yourself by writing some NSLogs in your callback. Then, run the app on a test device, and try closing the app after the connection has started. Wait for some time and reopen the app (still running 'Xcode'), and see what the delegate callsbacks are.

  // Annex Connection NSLog (@ "connection" has started ...); - (zero) connection: (NSURLConnection *) connection was filewidth error: (NSError *) error { NSLog (@ "failed with connection error -% @", error);} - (zero) connectionDifffish: loading: (NSURL connection connection) connection {NSLOG (@ "D-connection loading is ending ");}   

If you want to keep the connection (s) running after the user closes the app, then come OS application is read via 'Programming Guide. / P>

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

c# - Confused over DLL entry points (entry point not found exception) -