[array objectAtIndex:i] doesn't work as an L value, so it can't be used to set the object at index i.