UIApplicationDelegate becomeactive with options
I implemented association with files in my app that works pretty great but I still have ine problem that i cannot fugire out.
im my
- (BOOL)application:(UIApplication *)开发者_高级运维application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
I have this code. it doesn't work when the app become active from background.
NSURL *url = (NSURL *)[launchOptions valueForKey:UIApplicationLaunchOptionsURLKey];
any suggestion how can i make this work ?
Thanks.
This method:
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
is only called when you app just launched. Coming back from background is not launching your app.
You may find these two methods useful.
- (void)applicationWillEnterForeground:(UIApplication *)application {
- (void)applicationDidBecomeActive:(UIApplication *)application {
You need to also hook with applicationDidBecomeActive: when the app became active from multitasking.
精彩评论