开发者

Code execution prior to loading an url from an iPhone

开发者 https://www.devze.com 2022-12-21 16:53 出处:网络
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

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.

开发者_如何学PythonIs 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...


Have you tried putting something in the

- (void)applicationWillTerminate:(UIApplication *)application

method in your UIApplicationDelegate?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消