I have an existing array to which i want to add an other array in the front of the existing array.
Add to the end is no problem with
[existingArray addObjectsFromArray:newArray];
But how to add it to the front?
You can do this without a temporary array, and without assuming that newArray is an NSMutableArray, and without making an NSIndexSet:
[existingArray replaceObjectsInRange:NSMakeRange(0,0)
withObjectsFromArray:newArray];
You can try add objects to index below code:
[existingArray insertObjects:newArray atIndexes:0];
Thanks..!
To insert jjust before the existing array u must use index 0
[newArray insertObject: existingArray atIndex:0]