我想从我的代码中拍照。所以这是我调用相机的代码:
[self presentModalViewController:self.cameraViewController.imagePickerController animated:YES];
但是当它起作用时,我的父视图的dealloc
功能就起作用了。所以我需要这个视图信息。反正我可以用它来代替presentModalViewController
吗?或任何其他解决此问题的方法。谢谢。
编辑:我的 .h 类
@property(nonatomic,strong)CameraViewController_iPhone *cameraViewController;
我的 .m 课
-(void)openCamera{
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
[self.cameraViewController setupImagePicker:UIImagePickerControllerSourceTypeCamera];
self.cameraViewController.modalPresentationStyle = UIModalPresentationCurrentContext;
self.cameraViewController.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController:self.cameraViewController.imagePickerController animated:YES];
}
}