我有一个UItableViewController。在这个类里面有以下方法,我试图启动另一个UIViewController。我试图用一个SEGUE连接两个并赋予它一个识别码,然后使用这个版本:从UITableViewController启动UIViewcontroller崩溃应用程序
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"About to launch MyDetail View controller");
[self performSegueWithIdentifier:@"myDetailSegue" sender:self];
}
没有工作,应用程序冻结和我的main.m文件的消息如下:“”线程1接收到的信号SIGABRT”
所以后来删除了SEGUE并试图实例化的UIViewController如下,
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"About to launch my Detail View controller");
UIStoryboard *sboard = [UIStoryboard storyboardWithName:@"iPhone" bundle:nil];
UIViewController *myDetailVC = [sboard instantiateViewControllerWithIdentifier:@"myDetailVC"];
[self.navigationController pushViewController:myDetailVC animated:YES];
}
它的工作。但我现在感到困惑。为什么会产生UIStoryboard工作方式和SEGUE不是? 有人请帮忙, 我很困惑。
请张贴崩溃日志。 – Ilanchezhian 2011-12-30 05:32:11
哪里可以找到? – banditKing 2011-12-30 17:30:38