【发布时间】:2013-02-21 17:58:37
【问题描述】:
我有一个 UITableView 和第二个 Web 视图,我希望在触摸单元格时移动到它们。
我的问题是程序崩溃了
'NSInvalidArgumentException', reason: 'Receiver (<ViewController: 0x1e583890>) has no segue with identifier 'testing''
*** First throw call stack:
(0x326342a3 0x3a35197f 0x34647e31 0x78633 0x344fe28d 0x34580f81 0x32f42277 0x326095df 0x32609291 0x32607f01 0x3257aebd 0x3257ad49 0x361512eb 0x34490301 0x7724f 0x3a788b20)
libc++abi.dylib: terminate called throwing an exception
我已经查看了此处发布的每个解决方案、教程,但仍然看不出有什么问题。
我是故事板和 iOS 的新手
这是我的一些代码
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier:@"testing" sender:self];
}
是的,我确实有一个叫做“测试”的转场
我尝试注释掉 [self performSegueWithIdentifier:@"testing" sender:self]; 并使用
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if([segue.identifier isEqualToString:@"testing"]){
NSLog(@"identifier is equal");
webviewViewController *ViewController =segue.destinationViewController;
}
但是当单元格被按下时,什么也没有发生,并且@“identifier is equal”没有出现在日志中。
希望对你有帮助
【问题讨论】:
-
这里发生了什么:'webviewViewController *ViewController'?
-
您是否将您要从其中进行切换的控制器的类的名称更改为您拥有此代码的类?
-
这段代码在 ViewController 中(就像在 uitableview 中一样),我试图从它移到 webviewViewController
-
但是如果你点击故事板中的控制器(带有表格视图的那个),它的类是ViewController吗?
-
是的,它是 ViewContoller
标签: iphone ios objective-c uitableview segue