Question

If you call:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://test.com"]];

it seems to automatically quit your app -- bypassing the dealloc, viewDidDisappear, or any other functions.

Is there a way to put any code between this call and the Safari (or Phone or Email) launch, without having to put a timer before every openURL call?

====

EDIT: I need to call something only if one particular view is closed -- whether it's closed "politely", or abruptly...

Was it helpful?

Solution

Have you tried putting something in the

- (void)applicationWillTerminate:(UIApplication *)application

method in your UIApplicationDelegate?

OTHER TIPS

Why not put up a "launching Safari" screen, do what you need to, and then call the openURL method when all the work you need to do is done?

That said, since a user can also just press the Home button at any time you should be saving data as you go anyway.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top