objective-cxcodedebuggingstep-into

Have xcode step into every line of code


I'm trying to understand how a functionality works and then rewrite this functionality by stepping through the code while it is running to see exactly what it is doing. However, I'm noticing that Xcode is not stepping through every line of code. There is an instance, and I noticed it in a block, where the debugger just skips when I continuously press the step into button. It will stop if I put a breakpoint in one of the lines in the block, proving that Xcode is not going through this line by line, and it means it must be running lots of code that is not shown to me.

How can I make Xcode step through every line of code?


Solution

  • You need to add a breakpoint inside a block if it's being used in a dispatch_async or similar call. This is because that block of code is copied somewhere (usually a queue), and then executed separately. Often on a different thread.