tabBar 导航和从 UITableView 构建详细信息表

发布于 2024-11-06 07:38:40 字数 969 浏览 3 评论 0原文

我在 tabBar 导航中使用四个选项卡,第三个选项卡访问核心数据以加载已成功加载的表。我在创建详细信息表时遇到问题。我已设置并连接了详细的 nib 文件。我还设置了数据并正在运行。 当我点击一个单元格时,它会亮起,但没有任何反应。它甚至没有调用我的detailViewController。我已经为此苦苦挣扎了两天。如果有人有任何想法,请帮忙 - 谢谢

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{
    if (self.detailsView == nil) 
    {
        self.detailsView = [[TipsROTRDetailViewController alloc] 
                             initWithNibName:@"TipsROTRDetailViewController" bundle:[NSBundle mainBundle]];

    }
    TipsROTRInfo *info = [_fetchedResultsController objectAtIndexPath:indexPath];
    TipsROTRDetails *detailsText = info.details;

    self.detailsView.title = @"TIPS";
    self.detailsView.descriptionText =  detailsText.tipsText;
    //NSLog(@"Text: %@", self.detailsView.descriptionText); **I do get data here

    [self.navigationController pushViewController:self.detailsView animated:YES];
    //release it
    self.detailsView = nil;
}

I am using four tabs in my tabBar navigation, the third tab accesses Core Data to load a table which does get loaded successfully. I am having a problem creating a detail table. I have my detail nib file set up and connected. I also have the data set up and working.
When I tap on a cell, it lights up but nothing happens. It doesn't even call up my detailViewController. I've been struggling with this for two days. If anyone has any ideas, please help - thanks

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{
    if (self.detailsView == nil) 
    {
        self.detailsView = [[TipsROTRDetailViewController alloc] 
                             initWithNibName:@"TipsROTRDetailViewController" bundle:[NSBundle mainBundle]];

    }
    TipsROTRInfo *info = [_fetchedResultsController objectAtIndexPath:indexPath];
    TipsROTRDetails *detailsText = info.details;

    self.detailsView.title = @"TIPS";
    self.detailsView.descriptionText =  detailsText.tipsText;
    //NSLog(@"Text: %@", self.detailsView.descriptionText); **I do get data here

    [self.navigationController pushViewController:self.detailsView animated:YES];
    //release it
    self.detailsView = nil;
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

农村范ル 2024-11-13 07:38:40

检查您的镜框尺寸。

 NSLog(@" detail view frame: %f,%f %f x %f",detailsView.frame.origin.x,detailsView.frame.origin.y,
     detailsView.frame.size.width, detailsView.frame.size.height);

也许尺寸为 0(或非常小)或 x,y 超出屏幕。

Check your frame size.

 NSLog(@" detail view frame: %f,%f %f x %f",detailsView.frame.origin.x,detailsView.frame.origin.y,
     detailsView.frame.size.width, detailsView.frame.size.height);

Maybe the size is 0 (or really small) or the x,y is off-screen.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文