I am trying to clean up when the app is about to terminate/enter the background.
But, when the following code is called,
- (void)applicationWillTerminate:(UIApplication *)application
{
NSURL* url = [NSURL URLWithString:@"http://www.mysite.com/mobile/home?sysmethod=proclogout&systype=mobile&pagetype=jquerymobile"];
[self.webView loadRequest:[[NSURLRequest alloc] initWithURL:logoutURL]];
}
... the request starts loading, but never finishes. I read in Apple docs that apps have ~ 5 seconds to finish what they're doing once applicationWillTerminate: is called.
I don't believe the process is taking anywhere near that long, since I load this same request elsewhere in the app, and it always happens in mere milliseconds.
I have tried this both synchronously and asynchronously, with no luck either way.
Thanks for any thoughts!