I am adding a instance of NSMutableArray in NSArray.
Code:
NSMutableArray *var2=[[NSMutableArray alloc]init];
[var2 addObject:@"c++"];
NSArray *var1=[[NSArray alloc]initWithObjects:var2, nil];
[var2 addObject:@"c"];
[var2 addObject:@"wt"];
NSLog(@"Mutable%@",var2);
NSLog(@"Simple%@",var1);
Output:
2015-07-29 14:51:10.494 Kom4[3249:60b] Mutable(
"c++",
c,
wt
)
2015-07-29 14:51:10.496 Kom4[3249:60b] Simple(
(
"c++",
c,
wt
)
)
Question: NSArray size will be fixed at the time of initialisation. But we are passing instance of NSMutableArray .It is of flexible size. How is this showing the output?