views:

346

answers:

1

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 loose 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?

+3  A: 

There are a couple of things you can do. Add a Log function from the drop-down, then add another box and select Debugger Command and enter po f.name.

If you want your log to be more complicated, you could do something more like this:

the person name is: @(const char *)[(NSString*)[p.name description] UTF8String]@

You best bet is probably to just use the debugger's graphical interface to watch variables. If you want to log messages, use NSLog.

Jason Coco