2012-03-13 23 views
0

AgentDashboardNavigationController LIVES!放棄されたメモリが見つかりません

私はtabBarController内のagentDashboardNavigationController VCが編集インターフェイスVCに置き換えられて同じ手順を続けます。

完了すると、編集インタフェースが新しいagentDashboardNavigationControllerに置き換えられます。

何らかの理由で、生きているagentDashboardNavigationControllerオブジェクトの数が増え続けています。

基本的には、ビューコントローラの変更可能なコピー内のオブジェクトを置き換えることによって、その1つのタブに何が存在するかを前後に切り替えます。

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

はそれをスクラッチ。問題は保持サイクルでした。私が「レコード参照数」のビットをチェックしなければならないことが分かったら、その子がそれを保持していたのを見ることができました!

私の最初のものです。人は解決する苦痛です。

関連する問題