AVCaptureDeviceType 在 iPad Objective-C 上崩溃

AVCaptureDeviceType crashing on iPad Obejective-C

我的代码与 Apple 文档中的代码相同: https://developer.apple.com/library/archive/samplecode/AVCam/Listings/Objective_C_AVCam_AVCamCameraViewController_m.html#//apple_ref/doc/uid/DTS40010112-Objective_C_AVCam_AVCamCameraViewController_m-DontLinkElementID_7

NSArray<AVCaptureDeviceType> *deviceTypes = @[AVCaptureDeviceTypeBuiltInWideAngleCamera, AVCaptureDeviceTypeBuiltInDualCamera];

代码在这一行中断。

附上堆栈跟踪截图。 Stack Trace Screeshot

参考 link below.This 解决了我在低 iOS 版本的 iPad 上相机崩溃的问题。

https://github.com/imjerrybao/AVCam

Also make sure where your app is crashing. If it is Crashing because of core data(NSPersistentContainer) on lower versions of iOS, try using: INSPersistentContainer instead.

https://github.com/inspace-io/INSPersistentContainer