【发布时间】:2010-11-29 15:20:23
【问题描述】:
假设我将 UIViewController 传递给 UINavigationController,如下所示:
SettingsViewController *settingsRootView = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController" bundle:nil];
SettingsNavigationController *settingsView = [[SettingsNavigationController alloc] initWithRootViewController:settingsRootView];
[settingsRootView release];
[self presentModalViewController:settingsView animated:YES];
[settingsView release];
我在原始 UIViewController settingsRootView 上释放了我的保留,但 settingsView 保留了它。当我解雇settingsView 时,它应该释放自己和它的所有孩子,但由于某种原因它不是。有没有办法告诉我的主应用程序视图已使用settingsView 来强制我的主视图释放settingsView 及其所有子视图?
【问题讨论】:
标签: ios objective-c memory-management retain