8

Xcode 9 seems to be reporting a lot of Main thread calls to UIApplication properties. Even though the UI is not being updated this is particularly cumbersome due to the extension of logs it produces a default environment.

4   TestApp                             0x0000000101c262e0 __39-[ViewController viewDidLoad]_block_invoke + 196
5   libdispatch.dylib                   0x0000000102279654 _dispatch_call_block_and_release + 24
6   libdispatch.dylib                   0x0000000102279614 _dispatch_client_callout + 16
7   libdispatch.dylib                   0x0000000102289008 _dispatch_queue_serial_drain + 716
8   libdispatch.dylib                   0x000000010227ce58 _dispatch_queue_invoke + 340
9   libdispatch.dylib                   0x000000010228a1c4 _dispatch_root_queue_drain_deferred_wlh + 412
10  libdispatch.dylib                   0x00000001022917fc _dispatch_workloop_worker_thread + 868
11  libsystem_pthread.dylib             0x00000001ac6771e8 _pthread_wqthread + 924
12  libsystem_pthread.dylib             0x00000001ac676e40 start_wqthread + 4
4

2 回答 2

5

If these reporting messages confuse you uncheck them:

  1. Edit Scheme...enter image description here
  2. Uncheck "Main Thread Checker" in Run > Diagnostics enter image description here
于 2017-08-15T08:32:07.313 回答
0

Check also ARKit template Xcode project Main Thread Checker log console.

If UIApplication or UIApplicationDelegate method is called from another thread you can disable checking thread as in CGN answer, but it will disable this checker completely. You can also subclass what is necessary and call metod of superclass on main thread. This way you can still use Main Thread Sanitizer in other places in code

于 2019-07-30T08:20:15.393 回答