2

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

tilo
  • 14,009
  • 6
  • 68
  • 85

1 Answers1

0

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?

Infinite
  • 2,931
  • 2
  • 27
  • 33