I wanted to use a xib file to customise a tableview section in xcode (objective C), and here ar my files:
SectionHeaderView.xib is a UIView with a UILabel
Sectio
You can solve this issue by one of the following way:
1) you have derived SectionHeaderView from UIView
. derive this class with UIViewController
instead. This will resolve your issue.
2) Instead of using IBOutlet
property, Set Tag of UILabel
in view (say 101).
Discard SectionHeaderview class.
Keep SectionHeaderView.XIB, delete .m and .h files only.
use following code ins Viewforheader method of MasterViewController class:
{
UIViewController *vc=[[UIViewController alloc] initWithNibName:@"SectionHeaderview" bundle:nil]
UILable *lblTitle =[vc.view viewWithTag:101];
lblTitle.text =@"Text you want to set";
return vc.view;
}