我正在使用一个简单的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];
}
谢谢!