NSArray + remove item from array

后端 未结 7 1773
-上瘾入骨i
-上瘾入骨i 2020-12-15 03:29

How to remove an item from NSArray.

7条回答
  •  一生所求
    2020-12-15 03:44

    NSArray is not mutable, that is, you cannot modify it. You should take a look at NSMutableArray. Check out the "Removing Objects" section, you'll find there many functions that allow you to remove items:

    [anArray removeObjectAtIndex: index];
    [anArray removeObject: item];
    [anArray removeLastObject];
    

提交回复
热议问题