- Joined
- Mar 10, 2010
- Messages
- 10
- Reaction score
- 0
- Points
- 1
- Location
- Burbank, CA
- Your Mac's Specs
- iMac i5 27" OSX 10.6.2
Hi all,
Nethfel, I hope you catch this.
I have a NSDictionary with a handful of info in it represented as string keys and integer values. One item is "Difficulty Level", and it looks like this:
"Difficulty Level" => 2.
When I debug into my code and run "po" in the console, ala:
I see:
and if I do:
I get 2, just as I would expect.
However... when I run the code:
dl is some huge number.
What am I doing wrong??
Thanks!
Chris
Nethfel, I hope you catch this.
I have a NSDictionary with a handful of info in it represented as string keys and integer values. One item is "Difficulty Level", and it looks like this:
"Difficulty Level" => 2.
When I debug into my code and run "po" in the console, ala:
Code:
po settingsContent
I see:
Code:
"Difficulty Level" => 2
and if I do:
Code:
po [settingsContent objectForKey:@"Difficulty Level"]
I get 2, just as I would expect.
However... when I run the code:
Code:
- (int)difficultyLevel {
int dl;
if (settingsContent != nil)
dl = [settingsContent objectForKey:@"Difficulty Level"];
else
dl = 0;
return dl;
}
dl is some huge number.
What am I doing wrong??
Thanks!
Chris