NSInvalidArgumentException-接收者没有带有标识符的segue [英] NSInvalidArgumentException - receiver has no segue with identifier

查看:99
本文介绍了NSInvalidArgumentException-接收者没有带有标识符的segue的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了好几个小时,但没有任何效果.我试图在两个视图控制器之间进行选择,从一个tableViewController到另一个tableViewController. segue连接到顶层视图,而不是tableviewcell. Xcode中设置的标识符与代码中使用的标识符相同(复制和粘贴).昨晚一切正常,但现在我似乎无法使其崩溃而不会崩溃.

I have been trying everything for hours, and nothing's worked. I am trying to segue between two view controllers, from one tableViewController to another tableViewController. The segue is hooked up to the top level view, not the tableviewcell. The identifier that was set in Xcode is identical to the one used in the code (copy and pasted). It was working fine last night, but now i can't seem to get it to segue without crashing.

这里是调用segue的方法

here are the methods in which the segue is called

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

    self.photoList = [FlickrFetcher photosInPlace:[self.topPlacesList objectAtIndex:indexPath.row] maxResults:50];
    NSLog(@"photolist %@", self.photoList);

    NSLog(@"here");

    [self performSegueWithIdentifier:@"segue1" sender:self];
    NSLog(@"here");
}


-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if([segue.identifier isEqualToString:@"segue1"])
    {
        PhotosTableViewController *photosTVC = segue.destinationViewController;
        photosTVC.photoList = self.photoList;
    }
}

这是错误报告

2012-08-08 15:28:39.093 Top Places [512:f803] *由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'Receiver(PlacesTableViewController:0x6887ff0)没有标识符为'segue1的segue '' * :第一个引发调用堆栈: (0x13c0052 0x1551d0a 0xde24b 0x3efd 0xa771d 0xa7952 0x92f86d 0x1394966 0x1394407 0x12f77c0 0x12f6db4 0x12f6ccb 0x12a9879 0x12a993e 0x17a9b 0x2778 0x26d) 终止称为引发异常

2012-08-08 15:28:39.093 Top Places[512:f803] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (PlacesTableViewController: 0x6887ff0) has no segue with identifier 'segue1'' * First throw call stack: (0x13c0052 0x1551d0a 0xde24b 0x3efd 0xa771d 0xa7952 0x92f86d 0x1394966 0x1394407 0x12f77c0 0x12f6db4 0x12f6ccb 0x12a9879 0x12a993e 0x17a9b 0x2778 0x26d5) terminate called throwing an exception

这是情节提要的屏幕截图http://s14.postimage.org/66wf13q4h/Screen_Shot_2012_08_08_10_at_3 .png

推荐答案

我已修复它! 1.确保在Xcode中选择了正确的情节提要(如果重命名情节提要,请在项目摘要中对其进行更改).然后在模拟器上删除该应用并重新启动

i fixed it! 1. make sure the right storyboard is selected in Xcode(if you rename the storyboard change it in the project summary). then delete the app on the simulator and restart

这篇关于NSInvalidArgumentException-接收者没有带有标识符的segue的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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