I currently have a StationCalloutView that's a subclass of UIView (with a xib). Also I've got a Station thats a MKAnnotation and an StationAnnotationView that's a subclass of MKAnnotationView.
In StationAnnotationView to open StationCalloutView I'm doing this:
- (void)setSelected:(BOOL)selected animated:(BOOL)animated{
[super setSelected:selected animated:animated];
if (selected) {
self.calloutView = [[StationCalloutView alloc] initWithStation:self.annotation];
if (currentLocation) [self.calloutView calculateDistanceFromLocation:currentLocation];
[self.calloutView setOrigin:CGPointMake(-self.calloutView.frame.size.width/5.5, -self.calloutView.frame.size.height)];
[self animateCalloutAppearance];
[self addSubview:self.calloutView];
} else {
[self.calloutView removeFromSuperview];
}
}
It works perfectly but now I want to add a button to StationCalloutView but I when I click on my AnnotationView it get's deselected automatically and no touches are passed to StationCalloutView.
Does anybody has an idea on how to accomplish this?