@implementation YourViewController
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation
{
CalloutView *calloutView = however you load it from nib;
calloutView.button.tag = some unique id;
[button addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside];
return calloutView;
}
- (void)showDetails:(UIButton *)sender
{
NSLog(@"Button tag: %i was pressed", sender.tag);
}
@end
IOS uimap clicking callout button in subview
-
14-06-2023 - |
Frage
Im creating an app that uses uimap - IOS app . I have created a callout annotation that loads from a nib file and adds it as subview. now i'have added a button in the nib file and I cant get an event when clicking the button in the subview.
how can I make an event when the button in the subview is clicked ?
Thanks.
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow