Im creating a UITableView inside my UINavigationController, and the problem is that the table is covering the header of it. This is my class:
.h:
@interface SecondViewController : UINavigationController
@end
And part of the .m:
- (id)init
{
self = [super init];
if (self) {
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UITableView *mmm = [[UITableView alloc] initWithFrame:CGRectMake(0, 0,320, 100) style:UITableViewStylePlain];
[self.view addsubview:mmm];
}
What am I doing wrong?
I don’t think this is what you want to do.
The documentation for
UINavigationControlleradvises against subclassing. Instead, I think you want to create aUITableViewControllerand push that controller onto the navigation controller’s stack (or if this is root view controller, then initialize a navigation controller with thatUITableViewController.