Reputation: 2348
This is my error:
Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[__NSArrayI addObject:]: unrecognized selector sent to instance
I have no idea why this is happening. Both the array (which is NSMutableArray) and the object being added are definitely not nil, and the @property for the array is straight up (nonatomic, retain).
Can anyone help?
Upvotes: 0
Views: 1595
Reputation:
Chances are the array is not a NSMutableArray - a NSArray is not mutable, that is, you cannot add objects to it.
I know you said it is - but if you do
NSMutableArray* someArray = [NSArray array];
you get a NSArray, not a NSMutableArray. I've done it.
Upvotes: 3