János
János

Reputation: 35112

How to debug UI Xcode?

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?

Upvotes: 2

Views: 714

Answers (2)

mag_zbc
mag_zbc

Reputation: 6992

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

Upvotes: 1

Puneet Sharma
Puneet Sharma

Reputation: 9484

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

Upvotes: 3

Related Questions