UIImagePickerController在被解雇后重新加载视图? [英] UIImagePickerController reloads view after its dismissed?

查看:87
本文介绍了UIImagePickerController在被解雇后重新加载视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了选择器:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType =  UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
imagePicker.allowsEditing = NO;
[self presentModalViewController:imagePicker animated:YES];

我处理didFinishPickingMediaWithInfo:

and I handle the didFinishPickingMediaWithInfo:

- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
[picker release];}

但这会调用自己的viewDidLoad。这不正常吗?怎么回事?

but this calls the viewDidLoad on self. This is not normal is it? Whats wrong?

推荐答案

您的应用可能收到内存警告,导致屏幕上未显示的所有视图控制器卸载观点。当你在图像选择器中时这是很正常的,因为相机需要大量的内存。当您关闭图像选择器时,视图控制器会重新加载其视图。

Your app probably received a memory warning, which caused all view controllers who are not displayed on screen to unload their views. This is quite normal while you are in the image picker because the camera needs a lot of memory. The moment you dismiss the image picker your view controller reloads its view.

由于这是完全正常的行为,您的应用必须正确处理这种情况。

As this is perfectly normal behavior, your app must deal with this situation correctly.

这篇关于UIImagePickerController在被解雇后重新加载视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆