I'd like to create a couple of custom views, sort of reusable UI components, and would prefer to not layout the UI in code in the UIView subclass. I'd like to use a xib for that. I've used a xib by itself. And I've used a UIView subclass by iteself. But I haven't used them together. How do I "attach" them to one another? I'd like to use IBOutlets to access the UILabels in my custom view.
Will this kind of thing work?
NSArray *xib = [[NSBundle mainBundle] loadNibNamed:@"MyCustomView" owner:self options:nil];
MyCustomView *view = [xib objectAtIndex:0];
view.myLabel.text = @"fred";