0
我创建注释泡沫按钮用下面的代码:如何获得这些注释的气泡点击
-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation
{
if ([annotation isKindOfClass:[MKUserLocation class]])
return nil;
MKPinAnnotationView *view = [mapView dequeueReusableAnnotationViewWithIdentifier:@"ParkPlaceMark"];
if(!view)
{
view=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"ParkPlaceMark"];
}
UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[rightButton addTarget:self action:@selector(ShowDetails:)forControlEvents:UIControlEventTouchUpInside];
view.rightCalloutAccessoryView = rightButton;
[view setCanShowCallout:YES];
return [view autorelease];
}
我如何获得被点击的注解,让我去的细节与ID屏幕抓取数据库记录基于该ID来显示信息。
请帮忙。
没有质疑,相关型号,但不应该你只有在创建新视图时才会自动释放,而不是在出队时出现?应该崩溃... – Eiko 2010-10-12 07:31:54
它没有崩溃...应用程序工作正常。 – Amarpreet 2010-10-13 02:37:53