NSMutablearray move object from index to index

前端 未结 7 1022
无人共我
无人共我 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:20

    If you have an NSArray, you can't move or reorder anything as it is immutable.

    You need an NSMutableArray. With that, you can add and replace objects which, of course, also means you can reorder the array.

提交回复
热议问题