I get this warning and I am not sure how to fix it. The line where I get the warning is
NSInteger thescore = [[myDictionary objectForKey:@"Score"] objectAtIndex:0];
If it makes a difference, myDictionary is a NSDictionary
Edit: How is this? Btw my array is a NSMutableArray and not a NSArray
NSInteger thescore = [[myDictionary valueForKey:@"Score"] integerValue];
Edit 2: @Bavarious mentioned that I should do the following:
int thescore = [[myDictionary objectForKey:@"Score"] integerValue];
The result of call
[someArray objectAtIndex:0]is an object. AndNSIntegeris a primitive type:(cmd + double-click on
NSIntegerin xcode to see the definition)I guess you might actually be storing
NSNumberobjects in your array. In this case, you could do