I have 3 NSMutableArrays: a,b,c.
a= [b copy];
a= [c copy];
What happens to the elements that were first copied (from b)?
In my use -case, a is an array I use as DataSource for tableview, while b, an c are arrays that take the place of datasource when needed.
Thanks
Concrete example. In the end I got to use setArray.
-(IBAction)selectTab:(id)sender {
if ([(UIButton*)sender tag] == 1000) {
if (![self.butonLocuri isSelected]) {
[tableDataSourceArray setArray:locuriArray];
[self addPins:self.tableDataSourceArray];
[self.myTableView reloadData];
}
}
if ([(UIButton*)sender tag] == 2000) {
if(![self.butonEvenimente isSelected]){
[tableDataSourceArray setArray:evenimenteArray];
[self addPins:self.tableDataSourceArray];
[self.myTableView reloadData];
}
}
}
You should use
setArray:method.