Archive

Posts Tagged ‘Categories’

Moving objects in an NSMutableArray

May 1st, 2010 1 comment

A glaring omission from the NSMutableArray class is the ability to move an object from one index to another.  There are methods for adding and deleting objects but not for simply moving.  One great approach is to use a category on NSMutableArray.  When we were looking to optimize our code we found a very well documented blog post on this topic so we’ll just point you to our original source.  It’s quite useful and very simple to implement.

http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/