Add an object to the beginning of an NSMutableArray?

gurooj picture gurooj · Sep 3, 2011 · Viewed 27.3k times · Source

Is there an efficient way to add an object to start of an NSMutableArray? I am looking for a good double ended queue in objective C would work as well.

Answer

Manlio picture Manlio · Sep 3, 2011

Simply

[array insertObject:obj atIndex:0];

Check the documentation