3

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?

3 Answers 3

4

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 :)

Sign up to request clarification or add additional context in comments.

Comments

4

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

enter image description here

2 Comments

;) I bet typing po self->_text is faster and you can actually po even method calls po [self MyMethod];
I just wanted to share this information. If someone is focused on the keyboard, he might not know this possibility. I slightly changed my answer, because you are right speed is not the point. Thanks for your reply.
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.