Skip navigation.
 
mlLoading a custom view and its subviews from a nib
FROM : Robert Miller
DATE : Fri Jan 11 16:39:53 2002

Hello,

    This is probably a basic question but I've had no l uck solving the
problem. I have a custom view instantiated in my nib file. The view
contains other subviews such as buttons, etc. I want to be able to load
this custom view programatically and then install it as a subview of
some other view. I've been using NSBundle to do this and it appears to
create the view but not any of the subviews that are inside of the
custom view that is instantiated in the nib.. I've included one of the
coding attempts below? Any information on how to do this is greatly
appreciated.

NSBundle *bundle = [NSBundle mainBundle];
Class bundleClass  = [bundle classNamed:@"MyClassName"];
id component  = [[bundleClass alloc]
initWithFrame:NSMakeRect(0,0,256,64)];

Thanks in advance for any info.
Regards,
Bob M.


Related mailsAuthorDate
mlLoading a custom view and its subviews from a nib Robert Miller Jan 11, 16:39
mlRe: Loading a custom view and its subviews from a nib Stéphane Sudre Jan 11, 17:38
mlRe: Loading a custom view and its subviews from a nib Markus Hitter Jan 12, 13:20
mlRe: Loading a custom view and its subviews from a nib Matt Neuburg Jan 14, 20:28
mlRe: Loading a custom view and its subviews from a nib Henri Lamiraux Jan 14, 21:32
mlRe: Loading a custom view and its subviews from a nib Ondra Cada Jan 15, 00:08