I have created a nib file “tableHeaderView” where i have added some labels and images.
I then created a new class “tableHeaderViewClass” as a subclass of UIView and connected the different elements in the nib file to this class.
Then in interface builder i set the Custom class property of my nib file to: tableHeaderViewClass
In my table view controller i was hoping i could do the following:
tableHeaderViewClass *headerview = [[tableHeaderViewClass alloc] initWithFrame:frame];
headerview.titlelabel.text = @"Something";
[self.tableView setTableHeaderView:headerview];
But nothing happens. There is no view elements except for the space which the frame defined.
What is it i’m missing?
If you created a nib then get an instance from NSBundle loadNibName for your custom view
I assume your nib name is “tableHeaderViewClass”