【发布时间】:2012-01-27 16:38:47
【问题描述】:
我有两个 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'
在情节提要中,我选择了 view1,ctrl+left click+ drop 到 view2,然后我选择了push。另外,我已将 segue 标识符设置为 My identifier。那么我在这里缺少什么?
【问题讨论】:
标签: ios uistoryboard segue