これは、しかし...私は解決策を思いついた。私は、個々の注釈のタグ値を、テーブルビューを設定するために使用された配列のインデックスに基づいて設定しました。
-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control {
//So, we clicked that disclosure button
//TODO: This is really hacky... What is proper way to do this?
ServicesViewController *vc = [self.navigationController.viewControllers objectAtIndex:1];
[vc infoButtonPressed:control.tag];
は}今ServicesViewControllerに、私たちはこれを行うことができます:
- (void) infoButtonPressed:(NSInteger) index {
// decided against this first step, as graver's answer explains, it does not really make sense
//[self.navigationController popViewControllerAnimated:false];
//index should be nav array index we want to push
//so simulate a table-row click
[self tableView:self.tableView didSelectRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]];
は}
ああ良さ、私の...私はそれを考え出したと思います。開示ボタンのデリゲートをマップビューコントローラではなくテーブルビューコントローラに設定する必要がありますか?ダー。 – Bryan