iOS CoreLocation(null)崩溃

我通过Crashlytics在我的应用程序中收到此错误.我无法找到崩溃发生的地点和方式.以下是Crashlytics的日志:
Thread : Crashed: com.apple.main-thread
0  CoreLocation                   0x0000000183f62304 (null) + 60044
1  CoreLocation                   0x0000000183f230f0 (null) + 1436
2  CoreLocation                   0x0000000183f230f0 (null) + 1436
3  CoreLocation                   0x0000000183f2261c (null) + 1980
4  CoreFoundation                 0x0000000183754c9c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
5  CoreFoundation                 0x0000000183754940 __CFRunLoopDoTimer + 884
6  CoreFoundation                 0x0000000183752054 __CFRunLoopRun + 1520
7  CoreFoundation                 0x0000000183680dc0 CFRunLoopRunSpecific + 384

这也说明了:
崩溃:com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS位于0x6136383561626000

有人能指出我正确的方向吗?谢谢

解决方法

当应用程序变为非活动状态时,计时器需要无效.在 applicationWillResignActive方法中,使计时器对象无效.您可以在 applicationDidBecomeActive方法中重新设置它.来自文档:

You should use this method to pause ongoing tasks,disable timers,and
throttle down OpenGL ES frame rates. Games should use this method to
pause the game. An application in the inactive state should do minimal
work while it waits to transition to either the active or background
state.

如果要构建需要在后台收集位置的应用程序,请确保使用位置更新后台功能.

您还可以试用适用于iOS的HyperTrack SDK,它将为您设置更多功能,以便您可以构建您的位置功能,而不必担心这项繁重的工作. (免责声明:我在HyperTrack工作.)

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...