我在Xcode7.2上边运行,下边的代码只是黑屏,但不会崩溃。在Xcode8上运行,
崩溃了,难道iOS10之后,只能在真机上边运行了吗。小白求解~~~~
The simulator does not originally support this. It is recommended to use a real machine for debugging. If you have to run it on the simulator, just use code to block it:
#if !(TARGET_IPHONE_SIMULATOR) [self.captureSession startRunning]; #endif
The operation involving calling the camera must require a real machine
There is no way to call the camera simulator, only the real machine can. Xcode 8 simulator getting the camera will cause a crash, you can use
UIImagePickerController *picker = [[UIImagePickerController alloc]init]; picker.sourceType = UIImagePickerControllerSourceTypeCamera;
Try it, in picker.sourceType = UIImagePickerControllerSourceTypeCamera; there is a problem here, it can be called using a real device.
The simulator does not originally support this. It is recommended to use a real machine for debugging. If you have to run it on the simulator, just use code to block it:
The operation involving calling the camera must require a real machine
There is no way to call the camera simulator, only the real machine can. Xcode 8 simulator getting the camera will cause a crash, you can use
Try it, in picker.sourceType = UIImagePickerControllerSourceTypeCamera; there is a problem here, it can be called using a real device.