![](/img/trans.png)
[英]UICollectionView method (collectionView cellForItemAt indexPath ) not called
[英]SIGTRAP(TRAP_BRKPT) Crash in CollectionView cellForItemAt IndexPath
我在生產應用中遇到了奇怪的崩潰。 崩潰很少發生,我無法重現。
Crashed: com.apple.root.background-qos
0 AppName 0x104a4c040 ViewController.(collectionView(UICollectionView, cellForItemAt : IndexPath) -> UICollectionViewCell).(closure #1) (ViewController.swift:1018)
1 AppName 0x104a95270 _T0Ieg_IeyB_TR (Gif.swift)
2 libdispatch.dylib 0x1821cd088 _dispatch_call_block_and_release + 24
3 libdispatch.dylib 0x1821cd048 _dispatch_client_callout + 16
4 libdispatch.dylib 0x1821da378 _dispatch_root_queue_drain + 1028
5 libdispatch.dylib 0x1821d9f10 _dispatch_worker_thread3 + 120
6 libsystem_pthread.dylib 0x182473130 _pthread_wqthread + 1268
7 libsystem_pthread.dylib 0x182472c30 start_wqthread + 4
我正在使用后台隊列更新collectionView的cellForItemAt IndexPath中的核心數據對象。 我正在使用父子托管對象上下文來更新核心數據。
在1018行中,我有
DispatchQueue.global(qos: .background).async {
DatabaseOperations.sharedInstance.incomingMessageRead(true, message.messageId!)
}
位於cellForItem方法中。 誰能讓我知道是什么原因導致撞車事故,以及如何防止撞車事故發生? 謝謝。
通常sigtrap是用於意外的零,所以您可以警惕讓這部分:
message.messageId!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.