I have below code...
NSMutableArray *tArray = [[NSMutableArray alloc] init];
tArray = mainArray;
[tArray removeObjectAtIndex:mainArray.count-1];
In mainArray I have 4 items.
When I run above code what I was expecting is as below.
mainArray >> 4 items
tArray >> 3 items
However I am getting result as below.
mainArray >> 3 items (this is WRONG)
tArray >> 3 items
Any idea why the object is getting removed from main array when I do the removal from main array.