我正在使用一个简单的UISplitViewController
. UIImagePickerController
在我的主要视图(主视图)中,当用户完成拍照或点击取消时,我可以选择从相机拍照,我从控制台收到内存警告。有谁知道为什么会这样?
这是我展示控制器的方式:
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
cameraService = [[UIImagePickerController alloc] init];
cameraService.delegate = self;
cameraService.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:cameraService animated:YES completion:NULL];
}
这是我关闭图像选择器视图的方式:
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage * image
= (UIImage *)[info valueForKeyPath:UIImagePickerControllerOriginalImage]];
[picker dismissViewControllerAnimated:YES completion:nil];
}
谢谢!