我有一个应用程序,我最近转换为使用Apple的新指南针融合API。它曾经使用较旧的(现已弃用)API。这就是我启用运动更新的方式。如果定位服务不可用,我必须询问磁北,因为系统无法确定磁偏角来确定磁北的试北。如果你不这样做,指南针就会挂起,什么也不会发生if([CLLocationManagerheadingAvailable]){if([CLLocationManagerlocationServicesEnabled])[motionMgrstartDeviceMotionUpdatesUsingReferenceFrame:CMAttitudeReferenceFrameXTrueN