Joey FourSheds
Joey FourSheds

Reputation: 478

Why doesn't NSString always display its text in Xcode debugger?

It seems completely arbitrary, sometimes NSString will appear fine in the debugger:

 myStr  NSString *  0x0000000104e00040 @"Hello"

other times just:

myStr   NSString *  0x0000000104e00040

There's no problem with the NSStrings, just how they appear in the debugger. Are there any factors that influence this?

Upvotes: 3

Views: 2033

Answers (3)

orion elenzil
orion elenzil

Reputation: 5453

for the case where po myString isn't working, it might be if you're filtering console output in the IDE. eg, i'm filtering for "myFunc" and then do po myString. unless myString contains the string "myFunc", it doesn't show up. this also filters out the Print Description approach mentioned above.

i would argue that this is not the best behavior on XCode's part, and it would be better if the filter applied to only output from the program, not from the act of debugging.

Upvotes: 0

coco
coco

Reputation: 5020

You can also ctrl + click on an object, and choose Print Description.

enter image description here

Upvotes: 4

Daij-Djan
Daij-Djan

Reputation: 50129

it is a bug in the IDE I think, I don't think there's anything we can do about it.

maybe the stack depth influences that... but thats guesswork.

a po MyStr in the console always works fine :)

Upvotes: 4

Related Questions