2

Got this runtime warning, how to get line where it happens?

runtime: UI API called from background thread: -[UIView bounds] must be used from main thread only

Is it any breakpoints i.e. symbolic breakpointfor this?

2 Answers 2

3

Main Thread checker has an option for pausing at the issue. You just need to enable it.

EditScheme->Run->Diagnostics->RunTime API Checking-> Select both Main Thread Checker and Pause On Issues

enter image description here

Sign up to request clarification or add additional context in comments.

3 Comments

What to do if I don't have "Runtime API Checking" in diagnostic options?
@mag_zbc upgrade > Xcode 9. If you have an earlier version the option is not available but neither is the error message.
@luk2302 you have update your UI using DispatchQueue.main.async
1

The answer by Puneet Sharma is good, but it has a downside: it requires Xcode 9. However, what you want is possible in earlier version as well, using symbolic breakpoints

Symbolic breakpoint

It works, but I noticed it makes the app run dramatically slow, so whenever possible, use Puneet Sharma's method

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.