Three20 - Getting empty TableView when setting a TTTableViewController as TableBannerView
I have a TTTableViewContr开发者_如何学编程oller 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
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?
精彩评论