It looks like you are trying to add an int
to your NSMutableArray
. You can only add objects to an NSArray
, not primitive types. Try boxing in an NSNumber
in your implementation of push:
:
- (void) push:(int)numberToPush {
[self.data addObject:@(numberToPush)];
}