objective-c - NSInvalidArgumentException - 接收者没有带有标识符的 segue

标签 objective-c uiviewcontroller segue identifier uistoryboardsegue

我已经尝试了好几个小时,但没有任何效果。我试图在两个 View Controller 之间进行切换,从一个 tableViewController 到另一个 tableViewController。 segue 连接到顶层 View ,而不是 tableviewcell。 Xcode 中设置的标识符与代码中使用的标识符相同(复制并粘贴)。昨晚它运行良好,但现在我似乎无法让它在不崩溃的情况下继续运行。

这里是调用segue的方法

- (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 0x26d5) 终止调用抛出异常

here is a screenshot of the storyboard http://s14.postimage.org/66wf13q4h/Screen_Shot_2012_08_08_at_3_22_10_PM.png

最佳答案

我能够通过在 Xcode 的“产品”菜单下运行“干净”并在模拟器中重置内容和设置来修复它。

关于objective-c - NSInvalidArgumentException - 接收者没有带有标识符的 segue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11874200/

相关文章:

屏幕解锁或应用切换时的 iOS View / Controller 生命周期回调

swift - (Swift) 在 ViewController 的容器 View 中显示 TableViewController

ios - 如何使用 Xcode 基于 UItableViewCell 中的手势操作触发 UIViewController segue

ios - 读写一个 NSDecimalNumber

ios - #import 在 Xcode(版本 6.3)中找不到 .h 文件

ios - 如何知道选项卡栏在 iOS 中可见?

iphone - 翻转 ViewController 但保持与 Storyboard 相同的 NavigationController

ios - 如何唯一标识 UITableView 中的每个单元格

objective-c - 如何从 UICollectionViewCell 继续推送到导航 Controller ?

iphone - 如何在 UISplitViewController iPad 之前添加登录 View