Reputation: 17591
In my project I want to add an object in a specific position of a NSMutableArray, example:
if(index ==1) {
// I want add object at position 1 of NSMutableArray
}
if(index == 2) {
// I want add object at position 2 of NSMutableArray
}
...
if(index == 15) {
// I want add object at position 15 of NSMutableArray
}
How can I do?
Upvotes: 1
Views: 16386
Reputation: 49354
You could use a C array for this.
id objects[15];
objects[index] = yourObject;
Upvotes: 0