ios - 调用 UIImagePickerController (SourceType Camera) 卸载标签栏 Controller 中的其他页面(其他标签)

标签 ios objective-c view uiimagepickercontroller

我有 2 个选项卡,一个包含 imagepicker Controller ,另一个包含 UItableView 作为 uiview Controller 的 subview 。

我意识到当我调用 imagepicker Controller (SourceTypeCamera) 时,我在另一个选项卡中的页面正在被卸载('view didUnload' 方法)被触发。

这是我应该期望的正常行为吗? (其他选项卡的 View 被卸载)还是由于使用我应该注意的相机时出现内存问题?

最佳答案

正如您所说,viewDidUnload 可以随时触发,并且通常与低内存警告相关联, View Controller 的 View 否则即使在内存允许的情况下不需要也被缓存.因此,从严格意义上讲,这既不是预期的也不是意外的,因为它取决于系统其余部分的总状态。

也就是说,UIImagePickerController 在捕获图像时非常耗费内存(参见例如 this image,其中每个峰值都与 UIImagePickerController 的一个实例相关,根据 the related blog“捕获图像” ), 所以其他 View 被强制从内存中移除应该不足为奇。

没有记录在案的机制,也没有理由让 UIImagePicker 强制其他 Controller 推测性地转储它们的 View 。

关于ios - 调用 UIImagePickerController (SourceType Camera) 卸载标签栏 Controller 中的其他页面(其他标签),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6742719/

相关文章:

ios - objc_msgSend [__NSArrayM dealloc] 崩溃报告有时来自 Crashlytics

iphone - 如何更改铃声模式(静音或振动)

mysql - 使用 SELECT * 创建 MYSQL View

xcode - 通过链接到代码的外部目录在 XCode 中共享 ios 代码

ios - 执行选择器 :withObject:afterDelay: -- can I be certain that this is run on the main thread?

ios - UIButton颜色在iphone 8 plus和iphone X中有渐变(iOS版本独立问题)

ios - 语言标注器错误地标注为 'OtherWord'

iphone - "Gallery"app在IOS中分享 View

ruby-on-rails - Rails 3在另一个 Controller 中呈现部分形式

iOS:通过应用程序测试互联网连接的最佳方式是什么?