我收到此错误:
[CameraViewController presentViewController:animated:completion:]:无法识别的选择器发送到实例 0x8e07d0
代码片段是:
self.view.alpha = 0.5f;
[self.navigationController setNavigationBarHidden:YES];
UIImagePickerController *imagepicker=[[UIImagePickerController alloc]init];
[imagepicker.view setBackgroundColor:[UIColor blackColor]];
imagepicker.delegate=self;
imagepicker.sourceType=UIImagePickerControllerSourceTypeCamera;
[self presentViewController:imagepicker animated:YES completion:nil];
如果设备中有可用的摄像头,我已经检查了以前的控制器。当我在带有相机的设备上检查它时,就会出现这种情况。
我应该在最后一行有'nil'的地方有其他东西吗?