When my app tries to start CMMotionManager, it crashes with 'ahpl_main (30): EXC_BAD_ACCESS (code=1, address=0x4230)' error.
It's not always, but sometimes like when I tries to start CMMotionManager right after app is launched.
motionManager = CMMotionManager()
motionManager?.deviceMotionUpdateInterval = 1.0
guard motionManager.isDeviceMotionAvailable else { return }
motionManager?.startDeviceMotionUpdates(to: OperationQueue.current!, withHandler: { [weak self] (motion, error) in
})
This might be a memory issue..?
If I need to provide more information, I am happy to do so.
Thank you for your help.