Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print string value from breakpoint action in Xcode 4?

Tags:

I have a breakpoint action and am using the Log option from the drop down. I'd like to print out the string (summary) value. I'm doing this:

the person name is: @p.name@ 

but that prints the memory address. I can switch to the Debugger Command option and do

po f.name 

but then I lose my description, as used in the first option. Using the Log option, is there a way to print the string value and not the memory address?

like image 816
4thSpace Avatar asked Apr 12 '09 21:04

4thSpace


1 Answers

You can use NSLog statements with breakpoints using "Debugger Command", but you need to add "expr"

expr (void)NSLog(@"The Person Name is %@", p.name) 

-

using expr command with a Debugger Command as breakpoint in Xcode 4.4

like image 123
auco Avatar answered Sep 19 '22 16:09

auco