I am trying to add NSMutableArray in another NSMutableArray. But what I am trying to do is nested arrays.
My current code is:
NSMutableArray *array1 = [NSMutableArray arrayWithObjects: @"Red", @"Green", @"Blue", @"Yellow", nil];
NSMutableArray *array2 =[[NSMutableArray alloc] init];
[array2 addObject:array1];
This code is adding 4 objects in array2 but I want it to add array1 as single object.
Edit: This code is working I know but in my case in XCode something is wrong with initializing and it is adding 4 objects. I still could not figure it out. So this piece of code is working properly. So the problem was about initialization in a for loop.
NSDictionaryfor what you are expecting. When you assign array to an array, the result will be the same.