关闭回rootViewController

时间:2015-05-27 11:40:17

标签: ios objective-c uiviewcontroller

我已将第三方库导入到我的项目中,我将在appDelegate中使用深层链接。视图很好,但是当它移除这个库ViewController时它不起作用。

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

appbarViewController = [[AppBarViewController alloc] init];
self.window.rootViewController = appbarViewController;

[self.window makeKeyAndVisible];   
}

-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    if([[url host] isEqualToString:@"session"]){

   ACSViewController *acs = [[ACSViewController alloc] init];
    [window addSubview:[acs view]];
  [window.rootViewController presentViewController:acs animated:NO completion:nil];
}

然后从Library ViewController类中调用

[[self presentingViewController] dismissViewControllerAnimated:NO completion:nil];

我尝试了各种方法来解散popToRoot,但我没有回到原来的viewController。我在appDelegate中呈现库ViewController的方式是从堆栈中删除我的根吗?

0 个答案:

没有答案