PDA

View Full Version : Loading multiple nibs in the same controller




abushnaq
Aug 12, 2008, 09:50 AM
Hi Everyone,

I'm trying to create a custom view controller where one component comes in from one nib file and the second comes in from another(reason for this is that one component is inherited from a base class view controller). Is this even possible? If it is possible, are there any good references out there? I'm new to both Objective C and iPhone development.

Thanks,
Ahmad



gnasher729
Aug 12, 2008, 10:08 AM
Hi Everyone,

I'm trying to create a custom view controller where one component comes in from one nib file and the second comes in from another(reason for this is that one component is inherited from a base class view controller). Is this even possible? If it is possible, are there any good references out there? I'm new to both Objective C and iPhone development.

Thanks,
Ahmad

iPhone is under NDA.

For Cocoa, check out initWithNibName:bundle in NSViewController. It looks as if you want to override initWithNibName in your view controller; make it call initWithNibName for the superclass first which will load one nib file, and if the result is not NULL then call initWithNibName to load the view controller for another component from its own nib file.