在UISplitViewController中解除UIImagePickerController时接收内存警告

时间:2014-10-11 17:17:20

标签: ios objective-c uiimagepickercontroller uisplitviewcontroller memory-warning

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

谢谢!

0 个答案:

没有答案