Swapping nsmutabledata
I have one UIViewController containing a UITableView. Along with this I have 3 buttons and 4 Mutablable arrays.
Array "prime" is the primary datasource for the table view.
When I hit button a , b or c I write
prime= a
开发者_开发技巧[table reloadData];
or
prime= b
[table reloadData];
The problem I have is that after say 2 button pushes prime is not equal to either a or b. It contents now contain the contents of a "and" b and it's contents will continue to accumulate after every assign.
How can I make 1 nsmutuablearray switch its contents to be that of another?
I know I can just remove all objects and then add more. I more wanted to know if its possible to make prime be a pointer to a b or c?
Try instead: prime = [a copy];
精彩评论