tags:

views:

50

answers:

1

Hi,

I have an NSDictionary that when I NSLog prints this out

{
    206510 = 1;
    622845 = 1;
    926131 = "";
    100000977163362 = "";
}

Why does

[dict objectForKey:@"206510"]

gives null?

This is how I setup the dictionary in the first place.

[dict setObject:[status objectForKey:@"game_status"] forKey:(NSString*) [status objectForKey:@"id"]];

Thanks,
Tee

+1  A: 

Are your keys strings or numbers? NSDictionary keys off an id (your cast to NSString is unnecessary, and possibly wrong), eg. any objective-c object, you may want (entirely guesswork here):

[NSNumber numberWithDouble: 206510.0]
olliej