Reputation: 3657
I have several ViewControllers which subclass UITableViewController and have a Xib file where I set the TableViews appearances (style, colours etc) and add a header and footer.
There xib files do not appear to be getting loaded on iOS 5. On iOS 6 the xib is loaded and the view looks as expected.
iOS 6
iOS 5
Xib - Interface Builder
Any ideas?
Upvotes: 0
Views: 364
Reputation: 1
Thank. It's OK for Me
i add a method 'initWithMyNib
'
i replace 'initWithStyle
' with 'initWithMyNib
'
(id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self)
{
// Custom initialization
}
return self;
}
(id)initWithMyNib:(NSString*)strNibName
{
self = [super initWithNibName:strNibName bundle:nil];
if (self)
{
// Custom initialization
}
return self;
}
Upvotes: 0
Reputation: 3657
Turns out that prior to iOS 5 the UITableViewController designated initialiser did not load the Nib. This changed with iOS 6 and it now checks for a Nib.
To make the app work with both version I have made my designated initialiser call
self = [super initWithNibName:@"Nib Name" bundle:nil];
Upvotes: 1