Search code examples
objective-ccocoacocoa-touchnsmutablearraylvalue

How to change the value of an NSMutableArray at a particular index


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


Solution

  • Use -insertObject:atIndex: or replaceObjectAtIndex:withObject:.