Frederick C. Lee
Frederick C. Lee

Reputation: 9493

Unable to display variable values

Environment: Xcode Version 5.0.1 (5A2034a)
Scenario:
1) I've create a simple Apple-supplied iOS project template.
2) I create a local string value with an initial value; plus a local integer variable with value.
3) I did a debug 'po' & 'p' for the object and integer.

Simple method with debug access to local variables

Xcode's debugger apparently doesn't see these values.

The following are a couple of snippets of the debugger's environment:
enter image description here

enter image description here

As you can see, the debugger's symbol-generator is ON and the optimization is set to NO (zero).


1) Here's another example.

Note: NSLog() does work.
Notice the 'Turkey' for 'testString' value. Why this value?
'Turkey' was used in ANOTHER project and has no relevance to this one sample project.
It appears that I'm getting variable bleed from some xcode environment peculiar to Xcode 5; ...not found/experienced in Xcode 4.

Okay, this is weird. I've tried the NSLog() and got the values displayed. Then just for kicks I did a 'po' again and got the correct value.
However I still have the 'Turkey' value: enter image description here


2) Here's a second example.
Starting with a new application from the Apple-supplied view template:
enter image description here

This time, the NSLog() works but again, can't get the 'po' value.
I still haven't figured out the pattern here.

What else can I do?
How can I get my debugger 'po' & 'p' commands to show data?
Or... why am I'm getting inconsistent debugger behavior (Xcode5 appears to work okay; re 'NSLog()')?

Upvotes: 1

Views: 1392

Answers (1)

Frederick C. Lee
Frederick C. Lee

Reputation: 9493

I had this recurrent problem so I tried logging via a different account to find the problem disappeared.

So there's something wrong with my Xcode account; specifically:

enter image description here

So I emptied the Xcode folder found under ~/Library/Developer and restarted Xcode. Apparently the problem(s) is/are solved.

Upvotes: 1

Related Questions