目标注释不会弹出,只显示开始注释

时间:2011-12-31 21:31:17

标签: iphone mkmapview mkannotation

- (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views
 {
  [self showCallOut];
 }

 - (void)showCallOut {
//[map selectAnnotation:[map.annotations objectAtIndex:0] animated:YES];
int num=[map.annotations count];
[map selectAnnotation:[map.annotations objectAtIndex:(num-1)] animated:YES];
 }

上面的代码会自动在地图上显示开始的objectAtIndex:0注释,但如果我设置objectAtIndex:(num-1)这是目的地annoation,它就不会显示在地图上

0 个答案:

没有答案