我有3 NSMutableArrays
:a,b,c。NSMutableArray和副本
a= [b copy];
a= [c copy];
第一次複製的元素(從b)會發生什麼?
在我的使用-case中,a是一個數組,我用它作爲DataSource的tableview,而b,c是需要的時候代替數據源的數組。 謝謝
具體的例子。最後我得使用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];
}
}
}
這段代碼是用ARC還是沒有ARC編譯的? – tia