I have a list of arrays, each of elements of these is array to. I know, it's a little freaky, but it's necessary. So, I need to replace elements of deepest array. I've tried this:
for (int i = 0; i < [myArray count]; i++) {
for (int j = 0; j < [[myArray objectAtIndex:i] count]; j++) {
for (int k = 0; k < [[[myArray objectAtIndex:i] objectAtIndex:j] count]; k++) {
[[[myArray objectAtIndex:i] objectAtIndex:j] replaceObjectAtIndex:k withObject:@"Some_string"];
}
}
}
and got an error *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI replaceObjectAtIndex:withObject:]: unrecognized selector sent to instance. But I can to log this element, e.g. NSLog(@"%@", [NSString stringWithFormat:@"%@",[[[myArray objectAtIndex:0] objectAtIndex:0]objectAtIndex:0]]);, it's ok.
What it can be? Thanks for your help.