[array objectAtIndex:i] 不能作为 L 值使用,因此不能用于设置索引 i 的对象。
[array objectAtIndex:i]
请使用-insertObject:atIndex:或replaceObjectAtIndex:withObject:方法。
-insertObject:atIndex:
replaceObjectAtIndex:withObject: