How to empty an NSMutableArray ?

By | April 6, 2011

Hi,

Sometimes you may need to empty an NSMutableArray which is already initialized with some objects. You don’t need to release it and again alloc it for future use! You can simply empty an NSMutableArray using the following line of code.

[yourArray removeAllObjects];

Here ‘yourArray’ is your NSMutableArray.
🙂

Leave a Reply

Your email address will not be published. Required fields are marked *