0

I have a MenuViewController which is normally the rootviewcontroller. I use

- (IBAction)backToMenu:(UIStoryboardSegue*)unwindSegue {
}

to go back to this view controller from other view controllers. However, if the user launches the app by clicking on a local notification, the app shows OtherViewController. I do it like so:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

UILocalNotification *notify = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];

    if (notify) {
        UIStoryboard *tip = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        OtherViewController *viewTip = (OtherViewController *)[tip instantiateViewControllerWithIdentifier:@"OtherViewController"];
        [_window.rootViewController presentViewController:viewTip animated:YES completion:nil];
    }
} 

The app opens at the expected OtherViewController, but then when I click the menu button that normally triggers the unwindSegue, I can't go back to MenuViewController. Any thoughts on how to fix this?

Edit: I use push segue to go from MenuViewController to OtherViewController.

4

0 回答 0