开发者

calling initialization code on view which was created by loading nib from file

I loaded a view created by interface builder as follows:

NSArray *array = [[NSBundle mainBundle] loadNibNamed:@"MyView" owner:self options:nil];
MyVie开发者_运维技巧w *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?


use -awakeFromNib. This will be called the first time the class is deserialized from the nib.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜