内存警告后强制卸载活动模态视图
我在卸载视图时遇到问题,该视图当前处于活动状态并使用以下代码以模态方式显示:
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myContentController];
[navController setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
[self presentModalViewController:navController animated:YES];
出现内存警告后,该控制器通过 unloadViewForced: 方法卸载其视图。这会导致向用户显示黑屏。
有谁知道 unloadViewIfReloadable 使用什么标准来确定视图处于活动状态?在内存警告后,我可以在模态视图显示期间进行哪些设置来保护它。
I have a problem with a view being unloaded which is currenlty active and displayed modally using the following code:
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myContentController];
[navController setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
[self presentModalViewController:navController animated:YES];
After a memory warning this controller has its view unloaded via the unloadViewForced: method. This results in a black screen being displayed to the user.
Does anyone know what criteria unloadViewIfReloadable uses to determine that the view is active? What setup during the display of the modal view can I do to protect it after a memory warning.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这似乎是相关的:uiviewcontroller阻止视图卸载
This seems to be related: uiviewcontroller prevent view from unloading