Receiver()没有标识为"secondViewControllerSegue"的segue [英] Receiver () has no segue with identifier 'secondViewControllerSegue`

查看:46
本文介绍了Receiver()没有标识为"secondViewControllerSegue"的segue的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在xib文件中有一个自定义的tableview单元格.我在FirstViewController中使用此自定义单元格.我想在第一个viewController的didSelectRowAtIndexPath上显示SecondViewController.

I have a custom tableview cell in xib file. I am using this custom cell in my FirstViewController. I want to show SecondViewController on didSelectRowAtIndexPath of first viewController.

我正在像

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier:@"secondViewControllerSegue" sender:indexPath];
} 

我说错了-

"Receiver()没有标识为"secondViewControllerSegue"的segue"

'Receiver () has no segue with identifier 'secondViewControllerSegue''

我在这里想念什么?

推荐答案

转到情节提要,然后从第一个视图控制器(第一个视图控制器的黄色图标)到第二个视图控制器按Ctrl + Drag来创建序列.然后,在左侧面板上转到属性检查器"选项卡,并为您的segue设置标识符.然后,只需在您的 performSegue 方法中设置相同的标识符即可.

Go to your storyboard and Ctrl+Drag from the first view controller (the yellow icon of the first view controller) to the second to create a segue. Then on the left panel go to attributes inspector tab and set an identifier for your segue. Then just set the same identifier in your performSegue method.

这篇关于Receiver()没有标识为"secondViewControllerSegue"的segue的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆