Reputation: 1391
is there a way to see the currently line of code being ran in Xcode. With out using breakpoints but. A simple list of executions during run time. That were done on which line of code. So I can see where I'm at.
Upvotes: 0
Views: 739
Reputation: 2425
If you have a few places where you think the code is executed, you can use NSLog()
statements and see what is being printed to the console at what time.
or
Set a breakpoint (tap on a line number in Xcode) and manually run the code line by line using Xcode's Debug
menu. In your case you can set a breakpoint on the method that is executed when a button is pushed. If you do not know which method is called when you push the button, you could look at where the button is declared, which should have a addTarget
method, or see what it is hooked up to in the Storyboard.
Upvotes: 0
Reputation: 7351
You should use breakpoints. The OP mentioned he didn't want to have to set a ton of breakpoints to check every line, but that is not necessary.
This toolbar appears when execution is stopped via breakpoint. You can tap the fourth icon (with the bent arrow) to "step through" the application - this will advance execution 1 line at a time. Try out the last two buttons (step into and step out) while you're at it.
Upvotes: 1