Я добавил комментарии к вашему коду, которые показывают, что действительно происходит.
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSArray *name = [NSArray arrayWithObjects:@"Marina Bay Sands", @"Sentosa", @"Singapore
Polytechnic",nil];
NSArray *description = [NSArray arrayWithObjects:@"Got casino!!", @"Got Universal Studio
Singapore!!", @"Best polytechnic in Singapore!",nil];
self.mapAnnotations = [[NSMutableArray alloc] initWithCapacity:3];
//here you create the properties of the pin the first time
CLLocationCoordinate2D location;
location.latitude = (double)1.2822463547298561;
location.longitude = (double) 103.85830879211426;
//here you create the pin
MapPin *mapPin = [[MapPin alloc] init];
//now you set its properties
[mapPin setCoordinate:location];
[mapPin setName: [name objectAtIndex:0]];
[mapPin setDescription:[description objectAtIndex:0]];
//now you add it to the array
[self.mapAnnotations addObject:mapPin];
//now you are changing the properties of `mapPin`
location.latitude = (double) 1.249404;
location.longitude = (double) 103.830321;
[mapPin setCoordinate:location];
[mapPin setName: [name objectAtIndex:1]];
[mapPin setDescription:[description objectAtIndex:1]];
//the problem with adding mapPin again here is that you are adding
//the same object again, just with different properties, so
//your array still only has one object in it, `mapPin`, but with its updated properties
[self.mapAnnotations addObject:mapPin];
//you change the properties again here
location.latitude = (double) 1.309976;
location.longitude = (double) 103.775921;
[mapPin setCoordinate:location];
[mapPin setName: [name objectAtIndex:2]];
[mapPin setDescription:[description objectAtIndex:2]];
//and the same phenomenon I previously described happens again here
[self.mapAnnotations addObject:mapPin];
[self.mapView addAnnotations:self.mapAnnotations];
self.mapView.mapType = MKMapTypeStandard;
[self location];
mapView.showsUserLocation = YES;
Если вы не хотите создавать новые mapPins каждый раз, когда добавляете их вмассив, попробуйте это каждый раз, когда вы добавляете пин-код в массив:
вместо
[self.mapAnnotations addObject:mapPin];
try
[self.mapAnnotations addObject:[[mapPin copy] autorelease]];
Это добавит копию вашего измененногоmapPin вместо того, чтобы указывать на то же место в памяти, где находится исходный.