Me gustaría crear un par de vistas personalizadas, una especie de componentes UI reutilizables, y preferiría no diseñar la UI en código en la subclase UIView. Me gustaría usar un xib para eso. He usado un xib solo. Y he usado una subclase UIView por sí mismo. Pero no los he usado juntos. ¿Cómo los "adjunto" el uno al otro? Me gustaría utilizar IBOutlets para acceder a UILabels en mi vista personalizada.¿Cómo usar un xib y una subclase UIView juntos?
¿Funcionará este tipo de cosas?
NSArray *xib = [[NSBundle mainBundle] loadNibNamed:@"MyCustomView" owner:self options:nil];
MyCustomView *view = [xib objectAtIndex:0];
view.myLabel.text = @"fred";
Ver http://stackoverflow.com/a/5056886/385619 – Willster