NSMutablearray move object from index to index

前端 未结 7 1039
无人共我
无人共我 2020-12-05 04:05

I have a UItableview with reordable rows and the data is in an NSarray. So how do I move an object in the NSMutablearray when the appropriate tableview delegate is called?

7条回答
  •  孤街浪徒
    2020-12-05 04:09

    You can't. NSArray is immutable. You can copy that array into an NSMutableArray (or use that in the first place). The mutable version has methods to move and exchange its items.

提交回复
热议问题