Reputation: 351
I have code that contains a nested for loop, and I need to see the execution line by line so I can understand how the loop works.
When running the program, I need to press "enter" to execute the next line. I remember about a month ago I accidentally found it, I kept pressing "enter" until the last line was executed but unfortunately I forgot how. What is the procedure for doing this?
Upvotes: 1
Views: 2529
Reputation: 1131
You need to use a breakpoint.
It is an indication to the debugger that it should stop the execution of your app (in debug mode) when the execution reaches this point (you can also add conditions).
When it stops, what to do is up to you:
Try it, you will love it. Set a breakpoint, and when execution stops, go to the Xcode "Debug" menu.
Upvotes: 1