有时我的应用程序在启动时会崩溃。
它似乎与失败的后台 NSURL 会话活动有关。此消息在 Crashlytics 日志中相当一致地出现:
_block_invoke line 233 $ Error Domain=NSURLErrorDomain Code=-997 "Lost connection to background transfer service"
我对如何在 xCode 中调试此问题感到困惑,因为当我的测试设备连接到我的计算机时,我无法让它发生。
我没有在我的应用程序中使用 KVO;也许这是 AFNetworking 本身的问题?
以下是 Crashlytics 报告的崩溃消息:
Fatal Exception: NSInternalInconsistencyException
An instance 0x14f97ef00 of class __NSCFBackgroundDataTask was deallocated while
key value observers were still registered with it.
Current observation info: <NSKeyValueObservationInfo 0x14f97f320> ( <NSKeyValueObservance 0x14f841ea0: Observer: 0x14e777340, Key path: countOfBytesReceived, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x14e650010> <NSKeyValueObservance 0x14e6e1770: Observer: 0x14e777340, Key path: countOfBytesExpectedToReceive, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x14f81c090> <NSKeyValueObservance 0x14f80e030: Observer: 0x14e777340, Key path: countOfBytesSent, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x14f97e880> <NSKeyValueObservance 0x14e5ca9c0: Observer: 0x14e777340, Key path: countOfBytesExpectedToSend, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x14f97cf20> )
任何帮助,将不胜感激。