Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Main Thread Checker in Xcode

Tags:

ios

swift

ios12

I checked what's new in Xcode 9 documentation and I found this

enter image description here

But i didn't understand what is that how I can use this with new Xcode 9.

like image 892
Kishore Suthar Avatar asked Jul 06 '17 08:07

Kishore Suthar


People also ask

What is main thread checker?

The Main Thread Checker (MTC) is a runtime tool that throws a warning when system API calls that should be made on the main thread, such as UI operations, are incorrectly called on a background thread.

What is thread in Xcode?

The Thread Sanitizer, also known as TSan, is an LLVM based tool to audit threading issues in your Swift and C language written code. It was first introduced in Xcode 8 and can be a great tool to find less visible bugs in your code, like data races.

What is the main thread?

When an application component starts and the application does not have any other components running, the Android system starts a new Linux process for the application with a single thread of execution. By default, all components of the same application run in the same process and thread (called the "main" thread).

What is threads in iOS Swift?

Threads are especially useful when you need to perform a lengthy task, but don't want it to block the execution of the rest of the application. In particular, you can use threads to avoid blocking the main thread of the application, which handles user interface and event-related actions.


1 Answers

It can be enabled/disabled in the diagnostics option of the scheme. Besides, the "Pause on issues" is a comfortable option to debug these problems.

Xcode 11 enter image description here

Xcode <11 Example

like image 118
93sauu Avatar answered Nov 30 '22 12:11

93sauu