Can the "Main Thread Checker" tool be used with the Objective-c language?

Can the new "Main Thread Checker" tool be used with the Objective-c language?


Apple says:

Main Thread Checker works with Swift and C languages.



Objective-c is an extension of C, but not C.

Answered by DTS Engineer in 251076022

The Main Thread Checker works with Swift and the C family of languages - C, Objective-C, C++, and Objective-C++.

Yes, it works with Obj-C too.

Accepted Answer

The Main Thread Checker works with Swift and the C family of languages - C, Objective-C, C++, and Objective-C++.

Thank you!

The Main Thread Check option in my scheme is checked, but it's grayed out. I've intentionally added some UI code on a background thread, and the error is not shown at runtime. Why is the option grayed out? Why isn't it working? (I migrated my project from Xcode 8.3.3.)


(The Runtime Sanitization options also have some checkboxes grayed and the note "requires recompilation" but I don't think that applies to the thread checker. Anyway, I've recompiled and those other checkboxes are stilled grayed out.)

Apparently, the Main Thread Checker only works for code executing on the Simulator. If I select a Sim, the Main Thread Checker option in the Scheme is not grayed out.

I don’t think the simulator is the critical factor here, but rather iOS 11. I’m running Xcode 9.0b6 on macOS 10.12.6. When I connect up an iOS 11.0b10 device, the Main Thread Checker checkbox is enabled. When I connect up an iOS 10 device, it’s disabled.

29951764

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Can the "Main Thread Checker" tool be used with the Objective-c language?
 
 
Q