I have the following code (both items and itemsCopy are NSMutableArray's):
//DO: populate items w/ 30 elements
[self.itemsCopy addObjectsFromArray:self.items];
//DO: remove all elements in items
Results
Begin Pass 1:
itemsCopy = 0
items = 30
End Pass 1:
itemsCopy = 30
items = 0
Begin Pass 2:
itemsCopy = 0
items = 30
End Pass 2:
itemsCopy = 30
items = 0
How can I constantly append items to the end of itemsCopy? I would like the scenario to look like this:
Begin Pass 1:
itemsCopy = 0
items = 30
End Pass 1:
itemsCopy = 30;
items = 0;
Begin Pass 2:
itemsCopy = 30
items = 30
End Pass 2:
itemsCopy = 60
items = 0