How to empty an NSMutableArray ?

By | April 6, 2011


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.

Website Pin Facebook Twitter Myspace Friendfeed Technorati Digg Google StumbleUpon Premium Responsive

Leave a Reply

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