views:

253

answers:

1
A: 

Use [cardIndex unsignedIntValue] for the objectAtIndex: line.

You cannot give objectAtIndex: a pointer because it expects an unsigned integer.

For example:

NSDictionary *currentCard = [[NSDictionary alloc] initWithDictionary:[appData.cards objectAtIndex:[cardIndex unsignedIntValue]]];

EDIT:

It sounds like cardIndex is an int but somewhere along the lines it is being set as an NSNumber instance. As a hack, use [(id)cardIndex unsignedIntValue]. If this works, then it means you are using the wrong type for cardIndex (it should be NSNumber, not int).

dreamlax
Thanks dude! Although I get an "invalid receiver type int" warning.
mga
Tried casting as (NSUInteger) and still get the warning. Everything else works fine though... I just don't like warnings.
mga
Right on! Converted all necessary references to NSNumber. Thanks!
mga