I have a NSMutableDictionary instance and the keys I'm using are NSNumber* type.
In the scenario I have, I'm trying to use 'objectForKey' to retrieve an object in my dictionary that I know is present. But I keep getting nil for the result unless I make convert the key from NSNumber to NSString.
NSNumber *itemId = [NSNumber numberWithInt:5];
id *existingItem = [forRemovalLookup objectForKey:itemId];
if (existingItem == nil)
{
// expected: shouldn't be nil
NSLog(@"!!!!!Not expecting this to be nil");
}
Is there another operation I should use to test for the presence of a specific key in a dictionary?