Wednesday, January 25, 2012

Adding a NIB view at runtime


// Add MyView.xib to a UIView, in IB associate MyView.xib and the MyView class
NSArray* nibViews = [[NSBundle mainBundle] loadNibNamed:@"MyView" owner:self options:nil];        
MyView* o = [nibViews objectAtIndex:0];
[self addSubview:o];

No comments:

Post a Comment