我有这种情况
array = [[NSMutableArray alloc] initWithCapacity:4]; //in viewDidLoad
if (index == 0){
[array insertObject:object atIndex:0];
}
if (index == 1){
[array insertObject:object atIndex:1];
}
if (index == 2){
[array insertObject:object atIndex:2];
}
if (index == 3){
[array insertObject:object atIndex:3];
}
但是如果我按顺序插入对象就可以了,相反,如果我按以下顺序填充数组:0和3之后,它就不能正常工作,为什么???