Ios 从unwindSegue更改rootViewController

Ios 从unwindSegue更改rootViewController,ios,uiviewcontroller,appdelegate,unwind-segue,Ios,Uiviewcontroller,Appdelegate,Unwind Segue,我有一个MenuViewController,它通常是rootviewcontroller。我用 从其他视图控制器返回到此视图控制器。但是,如果用户通过单击本地通知启动应用程序,应用程序将显示OtherViewController。我是这样做的: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UILocalNotific

我有一个MenuViewController,它通常是rootviewcontroller。我用

从其他视图控制器返回到此视图控制器。但是,如果用户通过单击本地通知启动应用程序,应用程序将显示OtherViewController。我是这样做的:

- (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];
    }
} 
应用程序在预期的OtherViewController打开,但当我单击通常触发unwindSegue的菜单按钮时,我无法返回MenuViewController。有没有关于如何解决这个问题的想法


编辑:我使用push segue从MenuViewController转到OtherViewController

您在backToMenu IBOutlet中实现了什么?您是指在-IBActionbackToMenu中:UIStoryboardSegue*unwindSegue{}?没什么,我只是使用OtherViewController退出中的菜单按钮作为一个动作序列。您是否将此IBOutlet链接到故事板中的退出?是的,我链接了,如果我正常地从MenuViewController启动应用程序,然后转到OtherViewController并单击菜单按钮,它将返回到菜单。因此,没有问题。仅当应用程序从其他ViewController启动时,我无法转到MenuViewController。而不是PresentViewController推送视图控制器或使用PerformsgueWithIdentifier。。。。。
- (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];
    }
}