首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >StoryBoard不工作?

StoryBoard不工作?
EN

Stack Overflow用户
提问于 2013-07-06 14:59:50
回答 2查看 525关注 0票数 0

我试图更改DetailedViewController上的文本,但是每次单击单元格时都会得到这个错误。任何帮助都是非常感谢的。

*由于“NSInvalidArgumentException”异常而终止应用程序,原因是:“接收器()”没有标识符“MySegue”的segue

我的代码就是这样的。

代码语言:javascript
复制
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [feedsTableView cellForRowAtIndexPath:indexPath];

   [self performSegueWithIdentifier:@"MySegue" sender:indexPath];

    UILabel *title = (UILabel *)[cell.contentView viewWithTag:0011]; 
    NSLog(@"TITLE; %@", title.text);

    DetailViewController *nextView=[self.storyboard instantiateViewControllerWithIdentifier:@"detail"];
    [UIView  beginAnimations:nil context:NULL];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDuration:0.75];
    [self.navigationController pushViewController:nextView animated:NO];
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO];
    [UIView commitAnimations];
}

这是我的-prepareForSegue

代码语言:javascript
复制
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([[segue identifier] isEqualToString:@"MySegue"]) {

        // Get destination view
       DetailViewController *vc = [segue destinationViewController];


        // Pass the information to your destination view
        vc.title.text = @"lol";
    }
}
EN

回答 2

Stack Overflow用户

发布于 2013-07-06 15:04:44

您确定在故事板中有一个带有该标识符的segue吗?看看你的故事板。

票数 0
EN

Stack Overflow用户

发布于 2016-02-10 20:08:42

就我而言:

点击一个UITableViewCell将无法执行故事板索引。

忘记更改dequeCell..中默认的“重用标识符”

我的鞋没问题。目标视图控制器碰巧也是一个tableView控制器,而且我没有更改过普通的“重用标识符”。准备segue (加载destinationVC)会失败,因此不会调用segue;它看起来只是一个segue失败。

希望它能帮助到某个人,在蓝天下.

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17504115

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档