NSMutableArray *array; array = [NSMutableArray new]; [array addObject: @"Alessia"]; [array addObject: @"Michele"]; /* Now the array contains Alessia, Michele. */ [array replaceObjectAtIndex: 1 withObject: @"Nicola"]; /* Now the array contains Alessia, Nicola. */The object which is removed from the array (because it is being replaced) receives a release message; the object which is added to the array (because it replaces the other object) receives a retain message.