NSArray + remove item from array

pratik picture pratik · Nov 13, 2009 · Viewed 106.9k times · Source

How to remove an item from NSArray.

Answer

luvieere picture luvieere · Nov 13, 2009

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];