【问题标题】:The segue is not performing the push action [closed]segue 没有执行推送操作 [关闭]
【发布时间】: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


    【解决方案1】:

    “performSegueWithIdentifer”有一个错字。缺少一个字母“我”。试试“performSegueWithIdentifier”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-12
      相关资源
      最近更新 更多