views:

109

answers:

3

I set a property with this declaration:

@property (nonatomic,retain) NSDictionary *itemData;

to a dictionary with 1 key - val pair. The table view in my view then gets the one value for the dictionary fine as a section header. But when I go back to access that very same value, it is nil.

Any suggestions? I have been working on this for an hour and picking through documentation and I am ready to continue coding.

+1  A: 

You can do a custom getter and set a breakpoint to see where your code is using this propriety and where it is setting it to nil.

If you don't find that way, it's that you're accessing directly the pointer, search where you're using the pointer.

Also, is the dict also nil or only the object value?

EDIT

Ever better : you can set a breakpoint on your @synthesize itemData;

gcamp
A: 

In the debugger, stop on the line that sets your property to a value.

Now open up the "self" object using the variable view in the debugger window (top right) and right-click on the itemData variable, then select "watch variable". Then continue, when that variable changes the code will stop.

Kendall Helmstetter Gelner
A: 

did you allocate it? post your code so that we can further tell you to fix it.

Shweta Simply