首页 > 解决方案 > iOS App 在 iOS 12 上的编译器生成代码中崩溃

问题描述

我最近发布了一个用 Swift 4.2 编写的 iOS 应用程序的新版本,Crashlytics 报告说该应用程序在编译生成的代码中崩溃了 30 多次。我查看了我项目中的类,并试图重现崩溃失败。有没有人有办法解决编译器生成的代码中发生的崩溃?这是崩溃日志:

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

标签: iosswift

解决方案


Upate:无数小时后,我意识到这是由于我实施拉动刷新的方式。当拉动刷新事件发生时,我清空了支持集合,但我没有重新加载表视图。当我将表格视图拉得足够远并且表格视图从底部弹回时,它会尝试加载触发单元格的底部行。空集合导致崩溃。


推荐阅读