首页 > 解决方案 > 使用 PDFView 的意外出色背景 CATransaction

问题描述

再会,

我正在编写一个 macOS 应用程序,PDFKit PDFView但我经常遇到Unexpected outstanding background CATransaction快速滚动PDFView

SO上的大多数答案都指向在后台线程中更新UI,或在后台线程中更新绑定。但是我没有绑定或任何KVC类。我已经删除了所有dispatch_async调用,因此我的应用程序完全在主线程中运行,但仍然发生崩溃。

其他答案说这是操作系统中的错误。如果是这样,它是否已修复或何时修复(尽管我的机器无法运行最新的操作系统)或者同时解决了什么问题。

lldbNSScreenUpdate显示由于断言失败而中止调用的线程队列。

该线程的堆栈跟踪如下;

* thread #15, queue = 'NSScreenUpdate', stop reason = signal SIGABRT
  * frame #0: 0x00007fff52390b66 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x0000000100abb0f0 libsystem_pthread.dylib`pthread_kill + 333
    frame #2: 0x00007fff522ec1ae libsystem_c.dylib`abort + 127
    frame #3: 0x00007fff3570af8e QuartzCore`CA::Transaction::assert_inactive() + 858
    frame #4: 0x00007fff28224d12 AppKit`__42-[_NSScrollingConcurrentVBLMonitor resume]_block_invoke.131 + 228
    frame #5: 0x0000000100a3bd8f libdispatch.dylib`_dispatch_client_callout + 8
    frame #6: 0x0000000100a503d2 libdispatch.dylib`_dispatch_continuation_pop + 940
    frame #7: 0x0000000100a3e48f libdispatch.dylib`_dispatch_source_invoke + 658
    frame #8: 0x0000000100a5014f libdispatch.dylib`_dispatch_continuation_pop + 297
    frame #9: 0x0000000100a4741a libdispatch.dylib`_dispatch_async_redirect_invoke + 738
    frame #10: 0x0000000100a3dbea libdispatch.dylib`_dispatch_root_queue_drain + 723
    frame #11: 0x0000000100a3d8c3 libdispatch.dylib`_dispatch_worker_thread3 + 116
    frame #12: 0x0000000100ab816d libsystem_pthread.dylib`_pthread_wqthread + 1387
    frame #13: 0x0000000100ab7bed libsystem_pthread.dylib`start_wqthread + 13
Program ended with exit code: 9

我无法在我的代码中看到任何引用这些符号的任何内容。我也尝试过CATransactionDisableActionsPDFView

我试过Instruments在它上面运行,但我找不到任何不寻常的地方。

即使在错误和堆栈跟踪中搜索重要词的混合也没有结果。

希望有人可以指出我解决此问题的下一步。

谢谢你(读到这里)

标签: objective-cuser-interfacecocoa

解决方案


推荐阅读