【发布时间】:2016-05-02 15:38:43
【问题描述】:
我正在使用具有以下结构的应用程序
-UINavigationController (MAIN NAVIGATION CONTROLLER)
--UIViewController
---UITabBarController
-- UINavigationController1
---- UITableViewController1
-- UINavigationController2
---- UITableViewController2
-- UIViewController ( Logout Button is in this Controller )
现在我正在调用以下方法将用户注销到第一个 ViewController
[self.navigationController popToRootViewControllerAnimated:YES];
这里 self.navigationController = (主导航控制器)
但此代码不起作用,它不会在控制器下取消初始化。
-- UINavigationController1
---- UITableViewController1
-- UINavigationController2
---- UITableViewController2
我正在使用 ARC,所以我无法为所有控制器调用 release 方法,所以我该如何实现。
更新
这是我的推送代码:
//Property Declare in AppDelegate
@property (nonatomic,weak) UITabBarController *tabBarControllerRef;
// Below code Written in RootViewController of (MAIN NAVIGATION CONTROLLER)
-(void)moveToContentScreen {
AppDelegate *delegateRef = (AppDelegate *) [UIApplication sharedApplication].delegate;
delegateRef.tabBarControllerRef = [self.storyboard instantiateViewControllerWithIdentifier:@"tabbarReference"];
if (delegateRef.tabBarControllerRef) {
[self.navigationController pushViewController:delegateRef.tabBarControllerRef animated:YES];
}
}
【问题讨论】:
-
标签控制器呢?是
deinit吗?如果没有,你就有一个参考循环。
标签: ios objective-c uinavigationcontroller uitabbarcontroller dealloc