iOS应用在iOS 12上的编译器生成代码中崩溃 [英] iOS App crashed in compiler generated code on iOS 12
问题描述
我最近发布了用Swift 4.2编写的iOS应用程序的新版本,Crashlytics报告该应用程序在生成的编译代码中崩溃了30多次.我查看了项目中的类,并尝试不成功地重现崩溃.有没有人可以对在编译器生成的代码中发生的崩溃进行故障排除的方法?这是崩溃日志:
I have recently released a new version of an iOS app written in Swift 4.2 and Crashlytics reported the app crashed 30+ times in compiled generated code. I looked in the classes in my project and also tried to reproduce the crash unsuccessfully. Does anyone have a way of troubleshooting crashes that occur in compiler generated code? This is the crash log:
Crashed: com.apple.main-thread
0 dealers 0x1008f184c $S7dealers20BrowseViewControllerC05tableC0_12cellForRowAtSo07UITableC4CellCSo0jC0C_10Foundation9IndexPathVtF (<compiler-generated>)
1 dealers 0x1008f18b0 $S7dealers20BrowseViewControllerC05tableC0_12cellForRowAtSo07UITableC4CellCSo0jC0C_10Foundation9IndexPathVtFTo (<compiler-generated>)
2 UIKitCore 0x1ced08de4 <redacted> + 684
3 UIKitCore 0x1ced0932c <redacted> + 80
4 UIKitCore 0x1cecd4a04 <redacted> + 2256
5 UIKitCore 0x1cecf28f0 <redacted> + 140
6 UIKitCore 0x1cef877dc <redacted> + 1380
7 QuartzCore 0x1a5df9b74 -[CALayer layoutSublayers] + 184
8 QuartzCore 0x1a5dfeb2c CA::Layer::layout_if_needed(CA::Transaction*) + 324
9 QuartzCore 0x1a5d5d44c CA::Context::commit_transaction(CA::Transaction*) + 340
10 QuartzCore 0x1a5d8bd7c CA::Transaction::commit() + 608
11 QuartzCore 0x1a5cca170 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 324
12 QuartzCore 0x1a5d9329c display_timer_callback(__CFMachPort*, void*, long, void*) + 272
13 CoreFoundation 0x1a176601c __CFMachPortPerform + 188
14 CoreFoundation 0x1a178d868 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
15 CoreFoundation 0x1a178cfb4 __CFRunLoopDoSource1 + 440
16 CoreFoundation 0x1a1787d6c __CFRunLoopRun + 2140
17 CoreFoundation 0x1a17871f0 CFRunLoopRunSpecific + 436
18 GraphicsServices 0x1a3a00584 GSEventRunModal + 100
19 UIKitCore 0x1ceaded40 UIApplicationMain + 212
20 dealers 0x10079b8b4 main (AuctionDetailDocumentsSectionController.swift:22)
21 libdyld.dylib 0x1a1246bb4 start + 4
推荐答案
更新:经过无数小时后,我意识到这是由于我实施拉刷新的方式所致.当发生刷新刷新事件时,我清空了后备集合,但没有重新加载表视图.当我将表格视图拉到足够远并且表格视图从底部反弹回来时,它会尝试加载底部的行,从而触发一行的单元格.空集合导致崩溃.
Upate: After countless hours, I realized it was due to the way that I implemented pull to refresh. When a pull to refresh event happened, I emptied out the backing collection but I did not reload table view. When I pull down the table view far enough and the table view bounced back from the bottom, it tries to load the bottom rows which triggers cell for row. The empty collection caused the crash.
这篇关于iOS应用在iOS 12上的编译器生成代码中崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!