AgentDashboardNavigationController LIVES!
我继续执行相同的过程,我的tabBarController中的agentDashboardNavigationController VC被编辑界面VC替换。
完成后,编辑界面将替换为新的agentDashboardNavigationController。
由于某种原因,live agentDashboardNavigationController对象的数量不断增加。
基本上,我通过替换视图控制器的可变副本中的对象,在一个选项卡中来回翻转。
agentDashboardNavigationController交换:
NSMutableArray *newViewControllers = [self.mainTabBarController.viewControllers mutableCopy];
AgentDashboardNavigationController *agentDashboardNavigationController = [[AgentDashboardNavigationController alloc] init];
// cycle through until we find the agentcontroller and remove it
// for now that's the only controller that gets removed so we break
NSUInteger index = [newViewControllers indexOfObjectPassingTest: ^ BOOL (id obj, NSUInteger idx, BOOL *stop) {
return [[obj tabBarItem].title isEqualToString:@"Guest Card"];
}];
[newViewControllers replaceObjectAtIndex:index withObject:agentDashboardNavigationController];
[self.mainTabBarController setViewControllers:newViewControllers animated:NO];
[newViewControllers release];
[agentDashboardNavigationController release];
并将其换出:
UISplitViewController *splitVC = self.guestCardManagementController.splitViewController;
// remove agentTab
NSMutableArray *newViewControllers = [self.mainTabBarController.viewControllers mutableCopy];
// cycle through until we find the agentcontroller and remove it
NSUInteger index = [newViewControllers indexOfObjectPassingTest: ^ BOOL (id obj, NSUInteger idx, BOOL *stop) {
return [obj class] == [AgentDashboardNavigationController class];
}];
[newViewControllers replaceObjectAtIndex:index withObject:splitVC];
[self.mainTabBarController setViewControllers:newViewControllers animated:NO];
[newViewControllers release];
答案 0 :(得分:0)
抓一点。问题是保留周期。一旦我意识到我应该在“记录引用计数”位上打勾,我可以看到它的孩子保留了它!
我的第一个。那些人很难解决。