私は 2 つの UIViewController を持っています。view1 では、PIN を使用して注釈を管理するため、ユーザーがアクセサリ コントロールをクリックしたときに正確に view2 をプッシュする必要があります。私のコードは次のとおりです。
-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
NSLog(@"calloutAccessoryControlTapped");
[self performSegueWithIdentifer:@"My identifier" sender:self];
}
コンパイル時に、次の警告が表示されました。
Instance method '-performSegueWithIdentifer:sender:' not found (return type defaults to 'id')
そして実行中、アプリは明らかにこのスタックでクラッシュします:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[view1 performSegueWithIdentifer:sender:]: unrecognized selector sent to instance 0x7d94ca0'
ストーリーボードで、view1ctrl+left click+ drop
から view2 を選択し、次に を選択しpush
ます。また、セグエ識別子を に設定しましたMy identifier
。それで、私はここで何が欠けていますか?