Hello, here is what i am trying to do:
NSMutableArray *objectNames = [[NSMutableArray alloc] init];
for (Object *o in objectList){
if (![objectNames containsObject:o.name]) {
[objectNames addObject:o.name];
}
}
I am trying to go through an array of objects, then take the objects name (a string) and add it to a string array of objectNames.
This code works in the simulator just fine. but when i run it on the device i get this error.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFArray insertObject:atIndex:]: attempt to insert nil'