NSMutableArray *array = [[NSArray alloc] initWithObjects:@"Apranax Forte",
@"Actified",
@"Zostex 125 MG",
@"Zoprotec 30 MG",
@"Arveles 25 MG"];
[array insertObject:@"Ahmet" atIndex:[array count] + 1]; // Neither work
[array addObject:@"Ahmet"]
我想將Ahmet字符串附加到NSMutableArray數組對象......任何人都可以幫助我嗎?我不能將對象添加到NSMutableArray initializedWith 5字符串對象
'insertObject:atIndex:[array count] + 1' will never work。最後一個元素位於索引'[array count] -1'。你可以插入的最大索引是'[array count]' – user102008 2011-02-01 06:07:19