我的应用中有自定义视图,这是我的根视图控制器。从这个角度来看,我提出了另一种观点作为模态。现在,当我关闭模态视图时,我的模态视图的dealloc或viewDidUnload方法没有被调用,导致每次进入模态和放大时都会增加内存。回来。可能是什么原因?
下面是我从根视图控制器执行以呈现模态视图的代码
[self.actions setValue:^(MyAction *action, NSString *id){
MyModalController *aModalController = [[MyModalController alloc] initWithType:@"Modal"];
[self presentNavigationalModalViewController:aModalController];
[aModalController release];
}];
- (void)presentNavigationalModalViewController:(UIViewController *)iViewController {
UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:iViewController];
[aNavigationController.navigationBar setBarStyle:UIBarStyleBlack];
[self presentModalViewController:aNavigationController animated:YES];
[aNavigationController release];
}
点击我的模态上的“取消”按钮后,我会从显示此模式的根视图控制器执行以下代码。
[self dismissModalViewControllerAnimated:YES];