Reputation: 9545
I loaded a view created by interface builder as follows:
NSArray *array = [[NSBundle mainBundle] loadNibNamed:@"MyView" owner:self options:nil];
MyView *myView = [array objectAtIndex:0];
The view created in the nib also has a .h and .m UIView subclass associated with it. I have initialization code within my .m source file. What is the preferred method to call initialization code?
Upvotes: 0
Views: 132
Reputation: 11502
use -awakeFromNib. This will be called the first time the class is deserialized from the nib.
Upvotes: 1