Three20 - 将 TTTableViewController 设置为 TableBannerView 时获取空 TableView

发布于 2024-11-28 23:15:04 字数 946 浏览 0 评论 0原文

我有一个 TTTableViewController 并想要显示一个 tableBannerView (如图所示 在示例代码中)。要显示的视图又是一个 TTTableViewController:

- (void)toggleInfo {
  if(self.tableBannerView) {
    [self setTableBannerView:nil animated:YES];
  } else {
    CanteenInfoViewController *infoViewController = [[CanteenInfoViewController alloc] initWithCanteenID:[_canteen canteenID]];
    [self setTableBannerView:infoViewController.view animated:YES];
    [infoViewController release];
  }
}

但是,当调用 [selftoggleInfo] 时,显示的 tableBannerView 是空的(我已经检查过 [infoViewController createModel] 和 < code>[infoViewController viewWillAppear:] 被调用)。 以模态方式呈现 infoViewController 时 ([selfpresentModalViewController:infoViewControlleranimated:YES];),它会正确显示。

谁能给我提示我所缺少的东西吗?

谢谢, 蒂洛

I have a TTTableViewController and want to show a tableBannerView (as shown in the sample code). The view to show is again a TTTableViewController:

- (void)toggleInfo {
  if(self.tableBannerView) {
    [self setTableBannerView:nil animated:YES];
  } else {
    CanteenInfoViewController *infoViewController = [[CanteenInfoViewController alloc] initWithCanteenID:[_canteen canteenID]];
    [self setTableBannerView:infoViewController.view animated:YES];
    [infoViewController release];
  }
}

However, when calling [self toggleInfo], the tableBannerView that is shown is empty (I already checked that [infoViewController createModel]and [infoViewController viewWillAppear:] are called).
When presenting infoViewController modally ([self presentModalViewController:infoViewController animated:YES];), it is shown correctly.

Can anyone give me a hint on what I'm missing?

Thanks,
Tilo

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

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

发布评论

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

评论(1

九歌凝 2024-12-05 23:15:04

嗯...您创建 infoViewController...将其视图设置为横幅视图...这可能会增加视图保留计数,但是随后您释放控制器,这会导致控制器被破坏(其保留计数没有增加2),在没有控制器的情况下留下它的视图......你确定这就是你想要的吗?

Uhm... you create the infoViewController... set it's view as banner view... which probably increases the views retain count, but then you release the controller which results in a destruction of the controller(its retain count wasn't raised to 2), leaving it's view behind without a controller... are you sure that's what you want?

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