在我的项目中,我想在NSMutableArray的特定位置添加一个对象,例如:
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
}
我能怎么做?
最佳答案
使用[array insertObject:object atIndex:index];
关于objective-c - iOS:将对象添加到NSMutableArray的特定位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5754225/