segue没有执行推动动作[关闭]

我有两个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 to view2,然后我选择了push 。 此外,我已将segue标识符设置为My identifier 。 那么我在这里缺少什么?

采纳答案:

“performSegueWithIdentifer”有一个错字。 有一封字母'我'缺失了。 尝试“performSegueWithIdentifier”。

author: graham-perks

参考更多解答: The segue is not performing the push action ,转载请保留出处segue没有执行推动动作[关闭]及作者信息

Statement: We respect knowledge and authors. Since the content comes from the Internet and is intended for scientific research, any reprinters should retain the author's signature and origin. If you are the author of the content and feel in dispute, please contact email: 1076545519@qq.com. We will find out the situation and deal with it in time. We sincerely thank the author for his hard work.


更多:ios