【发布时间】:2012-07-16 11:26:00
【问题描述】:
使用[self presentModalViewController:videoViewController animated:YES]; 会叠加多个视图吗?
在 videoViewController 上,我加载了几个 UIWebView,每个都加载到一个视频中。我在该视图上有一个按钮,可以更改类别。单击类别按钮时,它会显示一个弹出视图,并且该视图内有几个用于不同类别的按钮。当按下其中一个按钮时,我正在执行以下操作以返回 videoViewController:
VideoViewController *videoViewController= [self.storyboard instantiateViewControllerWithIdentifier:@"VideoVC"];
[self presentModalViewController:videoViewController animated:YES];
这很有效,它会关闭类别弹出视图并返回到 videoViewController 加载不同的视频。但是,在收到“确实收到内存警告”消息后,多次更改类别我的应用程序开始崩溃。
我有一个类别“全部”,它会在所有视频中加载,但没有收到此类消息,但随后多次更改类别(每个类别在过滤时当然加载较少的视频)我得到了警告。
所以我真正的问题是,当我更改类别并致电[self presentModalViewController:videoViewController animated:YES]; 时,是否只是在每次更改类别时获取视图?因此,例如,如果我更改类别 5 次,我是否会有 5 个 videoViewController 视图彼此重叠?如果是这样,避免这种情况的最佳方法是什么?
我尝试[self presentModalViewController:videoViewController animated:YES]; 来查看是否会有所不同,但 viewViewController 不会重新加载,并且类别弹出视图也不会关闭。
这适用于 iPad 应用程序,如果有影响的话。
谢谢。
【问题讨论】:
标签: objective-c ios ipad storyboard viewcontroller