終止應用程序由於未捕獲的異常 'NSInvalidArgumentException',原因: '接收器()具有識別符 'MySegue''NSInvalidArgumentException '的,原因是:' 接收器(<ViewController中:>)具有標識符沒有賽格瑞「MySegue
沒有SEGUE- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UIViewController *viewController;
switch (indexPath.row) {
case AUDIO:
[self performSegueWithIdentifier:@"MySegue" sender:self];
break;
case PDF:
viewController = [[[PDFExampleViewController alloc] init]autorelease];
break;
case PROCEDURAL:
viewController = [[[ProceduralExampleViewController alloc] init] autorelease];
break;
default:
viewController = [[[UIViewController alloc] init] autorelease];
}
[self.navigationController pushViewController:viewController animated:YES];
}
當我按下tableviewcell那麼它應該顯示的viewController MySegue但它給出了終止應用程序由於未捕獲的異常「NSInvalidArgumentException」,原因的錯誤消息:「接收器()具有標識符沒有賽格瑞‘MySegue’」。
爲什麼它在storyboardsegue標識符存在時發生錯誤。
感謝您的幫助。
您確定此視圖控制器是從故事板加載的嗎?嘗試將'NSLog(@「my storyboard =%@」,self.storyboard);'放在方法的頂部。它是否記錄故事板,或者是否記錄爲空? –