それで… [UINavigationController pushViewController] は保持されませんよね?;) 私がしたことは、ナビゲーションスタックにプッシュされるコントローラーを初期化/割り当て、プッシュしてから解放することでした。ナビゲーションコントローラーはコントローラーを保持すると思いました。どうやら、そうではありませんでした。最初にプッシュされたときは明らかに機能しましたが、2回目は機能しませんでした。メモリが本当に解放された場所だと思います。ゾンビを有効にすると、(セッターから) 割り当て解除されたオブジェクトへのメッセージを取得していたことが明らかになりました。
pushViewController がコントローラーを保持すると思ったのはなぜですか? 知らない; 割り当てた場合、割り当て解除にも責任があると思って混乱したと思います。押した後は、ナビコントローラーの責任だろうとなんとなく思った。私が間違っていたようです。
私はまだこの感覚をつかむことを学んでいます (邪悪な C# とガベージ コレクションは私の心を焼き尽くしました!)。追加するものはありますか?
説明のために、これは間違っていたようです:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSUInteger section = [indexPath section];
NSUInteger row = [indexPath row];
if (selectionController == nil)
{
selectionController =
[[ConfigSelectionViewController alloc] initWithStyle:UITableViewStyleGrouped];
}
NSString *title = [self titleForSection:section row:row];
NSString *key = [self keyForSection:section row:row];
selectionController.configKey = key;
selectionController.title = title;
NSArray *listItems = [self itemsForSection:section row:row];
selectionController.list = listItems;
[self.navigationController pushViewController:selectionController animated:YES];
// DON'T DO THIS!
[selectionController release];
}