Wrapping the tableView in a custom view in UITableViewController
Ever wanted to add a different view north of your table view without making it the tableHeaderView?
Here’s what you need:
@property (nonatomic, retain) UITableView *internalTableView;
- (void)loadView;
{
[super loadView];
self.internalTableView = self.tableView;
self.view = [[[UIView alloc] initWithFrame:self.view.frame] autorelease];
[self.view addSubview:self.tableView];
self.tableView.frame = self.view.bounds;
}
- (void)viewDidUnload;
{
self.internalTableView = nil;
[super viewDidUnload];
}
- (void)dealloc;
{
internalTableView = nil;
[super dealloc];
}
// here's the finesse
- (UITableView *)tableView;
{
if (!self.internalTableView) {
return [super tableView];
}
return self.internalTableView;
} 
Ullrich 16:24 on 13. September 2010 Permalink
When you’re importing the header files make sure to import them “framework style”:
#import <TheFramework/TheHeader.h>If you still can’t find your framework headers make sure your target is actually linked against them.