关于presentViewController时存在的内存泄漏问题,求助大神
1个回答
展开全部
//在a控制器中
CCChoosePhotoViewController * allPhotosVC = [[CCChoosePhotoViewController alloc]init];
// [self.navigationController pushViewController:allPhotosVC animated:YES];
UINavigationController * nav = [[UINavigationController alloc]initWithRootViewController:allPhotosVC];
nav.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:nav animated:YES completion:nil];
nav = nil;
allPhotosVC = nil;
消失部分,在CCChoosePhotoViewController中执行dismiss 操作。
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
CCChoosePhotoViewController * allPhotosVC = [[CCChoosePhotoViewController alloc]init];
// [self.navigationController pushViewController:allPhotosVC animated:YES];
UINavigationController * nav = [[UINavigationController alloc]initWithRootViewController:allPhotosVC];
nav.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:nav animated:YES completion:nil];
nav = nil;
allPhotosVC = nil;
消失部分,在CCChoosePhotoViewController中执行dismiss 操作。
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询