J'ai un problème avec MKPointAnnotation
. Je veux créer mon application iPhone comme ceci:Comment obtenir une description pour chaque épingle, dans Google Maps pour l'iPhone
- Afficher une épingle dans Google Maps
- Afficher une description sur chaque broche, tirant cette description d'un
NSMutableArray
.
Alors, Ma question est, comment puis-je afficher une description sur chaque broche?
Ceci est mon code:
NSMutableArray *points = [[NSMutableArray alloc] init];
for(int i=0; i < [dataTable count]; i++) {
MKPointAnnotation *point =[[MKPointAnnotation alloc] init];
CLLocationCoordinate2D coordinate;
coordinate.latitude = [[[dataTable objectAtIndex:i] objectForKey:@"latitude"] floatValue];
coordinate.longitude = [[[dataTable objectAtIndex:i] objectForKey:@"longitude"] floatValue];
[point setCoordinate:coordinate];
[point setTitle:[[dataTable objectAtIndex:i] objectForKey:@"name"]]; //-- name of pin
[points addObject:point];
}
[map addAnnotations:points];