Objective c 在选项卡栏和nab栏中弹出视图时出现问题

Objective c 在选项卡栏和nab栏中弹出视图时出现问题,objective-c,ios,uinavigationcontroller,uitabbarcontroller,Objective C,Ios,Uinavigationcontroller,Uitabbarcontroller,我有一个UITabBarController,它是UINavigationBarController中的第二项。UITabBarController中有两个视图,其中一个是名为AccountViewController的UIViewController子类。明白了吗 Login View Controller -> UIViewController + UITabBarController - > Account View Tab -> Button 我想使用一个按钮-注销-

我有一个UITabBarController,它是UINavigationBarController中的第二项。UITabBarController中有两个视图,其中一个是名为AccountViewController的UIViewController子类。明白了吗

Login View Controller -> UIViewController + UITabBarController - > Account View Tab -> Button

我想使用一个按钮-注销-弹出回到登录视图。我该怎么做

假设您正在其中一个
uiviewcontroller
中创建
uitabarcontroller
,它是
UINavigationController
中视图控制器字符串的一部分,您在其中执行了类似的操作:

UITabBarController *mytabs = [[UITabBarController alloc] init];
[self.view addSubview:mytabs.view];
mytabs.delegate = self; // This is key to getting back your UINavigationController
您可以从添加到
mytabs的
UIViewControllers
中的一个调用此函数。viewControllers
数组如下:

[[(UIViewController *)self.tabBarController.delegate navigationController] popViewControllerAnimated:YES];

您还可以指定是否希望它转到UINavigationController堆栈中的特定viewController索引(以防您的登录viewController不是下一个或根视图控制器)。

您的登录视图是模态视图控制器,对吗?