Reputation: 2661
I have an NSString variable called myText
.
How to watch [myText length]
in xcode debugger?
Upvotes: 6
Views: 575
Reputation: 72676
You can use the debugger console to evaluate a property of an object in Xcode, the debugger output view actually functions as an input, too.
Obviously first you have to Hit a breakpoint ...
It actually works with GDB and LLDB and you have to type in the output console :
print (int)[myText length]
Upvotes: 4
Reputation: 4473
In addition to @aleroot's solution, you can use the variable view of the debugger as well. You can right click on the view and select "Add Expression" and type in whatever you want to monitor. It is a little cumbersome compared to @aleroot's solution, but the merit of this method is that it automatically shows again when you hit the same breakpoint next time.
Upvotes: 3