I searched everywhere for this, on the Internet, on stack overflows and cannot still understand what I'm doing wrong.
I am trying to add an element to an existing NSMutableArray. But it crashes on line 4:
-[__NSArrayI addObject:]: unrecognized selector sent to instance 0x897b320
Code:
NSMutableArray *mystr = [[NSMutableArray alloc] init]; mystr = [NSArray arrayWithObjects:@"hello",@"world",@"etc",nil]; NSString *obj = @"hiagain"; [mystr addObject:obj];
What am I doing wrong? It drives me crazy!!!
source share