我的应用程序对我和测试人员检查过的所有设备和模拟器都运行良好。但它针对特定用户崩溃了。我从他的设备上获取了崩溃日志,但无法理解崩溃的原因。
这是我的崩溃日志:
Date/Time: 2018-07-25 11:41:53.4778 -0700
Launch Time: 2018-07-25 11:41:49.3381 -0700
OS Version: iPhone OS 11.4 (15F79)
Baseband Version: 1.93.00
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Application Specific Information:
abort() called
Filtered syslog:
None found
Last Exception Backtrace:
0 CoreFoundation 0x184786d8c __exceptionPreprocess + 228
1 libobjc.A.dylib 0x1839405ec objc_exception_throw + 55
2 CoreFoundation 0x18471fd80 -[__NSSingleObjectArrayI objectAtIndex:] + 127
3 UIKit 0x18ecfdaa8 -[UITableViewDataSource tableView:cellForRowAtIndexPath:] + 171
4 UIKit 0x18ea160f4 -[UITableViewController tableView:cellForRowAtIndexPath:] + 67
5 UIKit 0x18e4600cc -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 667
6 UIKit 0x18e45fd84 -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 79
7 UIKit 0x18e45eaa0 -[UITableView _updateVisibleCellsNow:isRecursive:] + 2279
8 UIKit 0x18e45a5ec -[UITableView layoutSubviews] + 139
9 UIKit 0x18e3976f4 -[UIView+ 308980 (CALayerDelegate) layoutSublayersOfLayer:] + 1419
10 QuartzCore 0x18890dfec -[CALayer layoutSublayers] + 183
11 QuartzCore 0x18891217c CA::Layer::layout_if_needed+ 1208700 (CA::Transaction*) + 323
12 QuartzCore 0x18887e830 CA::Context::commit_transaction+ 604208 (CA::Transaction*) + 319
13 QuartzCore 0x1888a6364 CA::Transaction::commit+ 766820 () + 579
14 UIKit 0x18e655598 _afterCACommitHandler + 255
15 CoreFoundation 0x18472e910 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 31
16 CoreFoundation 0x18472c238 __CFRunLoopDoObservers + 411
17 CoreFoundation 0x18472c884 __CFRunLoopRun + 1435
18 CoreFoundation 0x18464cda8 CFRunLoopRunSpecific + 551
19 GraphicsServices 0x186631020 GSEventRunModal + 99
20 UIKit 0x18e669758 UIApplicationMain + 235
21 Visits 0x1021b5418 main + 21528 (Location+CoreDataClass.swift:15)
22 libdyld.dylib 0x1840ddfc0 start + 3
并且(Location + CoreDataClass.swift:15)文件具有以下代码
10 import Foundation
11 import CoreData
12 import CoreLocation
13
14 @objc(Location)
15 public class Location: NSManagedObject {
16
17 @objc var coordinate : CLLocationCoordinate2D {
18 get{
19 return CLLocationCoordinate2D(latitude: self.latitude, longitude: self.longitude)
20 }
21 }
tableView数据源的代码:
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
guard let sectionInfo = fetchedResultController.sections?[section] else {
return 0
}
return sectionInfo.numberOfObjects
}
func numberOfSections(in tableView: UITableView) -> Int {
guard let sections = fetchedResultController.sections else{
return 0
}
return sections.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: visitCellIdentifier, for: indexPath)
configure(cell: cell, for: indexPath)
return cell
}
需要了解崩溃的原因。我已经对该应用程序进行了一个多月的测试,但是还没有崩溃。但是该用户甚至无法启动该应用。