我(希望)有一个小问题。rightCalloutAccessoryView
按钮方法。我尝试将其推到navigationcontroller
,another viewcontroller
但它不能正常工作。我总是黑屏。已navigationBar
禁用
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
// ... code ...
pinAnnotationView.canShowCallout = YES;
UIButton *detailButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[detailButton addTarget:self action:@selector(showDetailView:) forControlEvents:UIControlEventTouchUpInside];
pinAnnotationView.rightCalloutAccessoryView=detailButton;
// ... code ...
}
按钮:
-(IBAction)showDetailView:(UIButton *)sender
{
InfoViewController *infoView = [[InfoViewController alloc] init];
[self.navigationController pushViewController:infoView animated:YES];
NSLog(@"pushed Button!!!!!!");
}
我的目标:ViewController
按下detailButton
并推到InfoViewController
。
也许这只是一个小错误,我没有发现。