@trojanfoe, there is a simple error in your answer.
The first line of code does not return anything according to the document. It should be,
id object = [[array objectAtIndex:0] retain]; [array removeObjectAtIndex:0]; [array insertObject:object atIndex:2]; [object release];
source share