I want to learn how I can use for-each statements in 2D NSMutableArray. My code is below. It throws an exception at the 3rd (inner-most) for statement. The exception is:
"Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber count]: unrecognized selector sent to instance"
My code:
NSMutableArray* subTryingSet=[NSMutableArray arrayWithArray:[self genSetNumbers:arrRandoms withSize:4]];
for (NSMutableArray* oneRow in subTryingSet) {
for (NSMutableArray* w in oneRow) {
for (int i=0;i<w.count;i++) {
NSLog(@"%d", [[w objectAtIndex:i] intValue]);
}
}
}