The immediate cause of your crash is this:
Code Block Exception Type: EXC_BREAKPOINT (SIGTRAP) |
Exception Codes: 0x0000000000000001, 0x000000019a1add00 |
This strongly suggests that you’ve hit a trap, that is, the code has detected an unrecoverable problem and deliberately crashed.
Consider the backtrace of the crashing thread:
Code Block Thread 6 name: Dispatch queue: ELEReportPDFRenderer |
Thread 6 Crashed: |
0 libdispatch.dylib … _dispatch_assert_queue_fail + 112 |
1 libdispatch.dylib … _dispatch_assert_queue_fail + 104 |
2 libdispatch.dylib … dispatch_assert_queue$V2$VARIANT$armv81 + 144 |
3 UIKitCore … -[UIImageView _mainQ_beginLoadingIfApplicable] + 72 |
… |
23 UIKitCore … -[UINib instantiateWithOwner:options:] + 1064 |
24 elektra … +[UIView(Elektra) instantiateWithNibName:bundle:owner:] + 86793224 (UIView+El… |
25 elektra … +[UIView(Elektra) instantiateFromNibWithOwner:] + 86790452 (UIView+Elektra.m:… |
26 elektra … +[ELEMeasurementView measurementViewWithReuseIdentifier:] + 40093136 (ELEMeas… |
27 elektra … +[ELEMeasurementView measurementViewConfiguredForMeasurement:completionBlock:… |
28 elektra … -[ELEBasicReportPDFRenderer drawMeasurementGroup:] + 18411720 (ELEBasicReport… |
29 elektra … -[ELEReportPDFRenderer PDFData] + 45446276 (ELEReportPDFRenderer.m:390) |
30 elektra … +[ELEReportPDFRenderer PDFDataFromReport:progressBlock:] + 45398428 (ELERepor… |
31 elektra … __50-[ELEReportContentPreferencesController createPDF]_block_invoke + 4499318… |
32 libdispatch.dylib … _dispatch_call_block_and_release + 24 |
33 libdispatch.dylib … _dispatch_client_callout + 16 |
34 libdispatch.dylib … _dispatch_lane_serial_drain$VARIANT$armv81 + 568 |
35 libdispatch.dylib … _dispatch_lane_invoke$VARIANT$armv81 + 404 |
36 libdispatch.dylib … _dispatch_workloop_worker_thread + 692 |
37 libsystem_pthread.dylib … _pthread_wqthread + 272 |
38 libsystem_pthread.dylib … start_wqthread + 8 |
Frame 38 shows that this is a dispatch worker thread. Frames 31 through 24 are your code, which then calls UIKit at frame 23. This is not legal. You are not allowed to call UIKit from a secondary thread; you can only call it from the main thread.
UIKit has detected this problem and trapped.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"