A: 

Yeah, IB on iPhone really wants File's Owner to be a UIViewController subclass, which makes what you want to a bit tricky. What you can do is load the nib against an existing UIViewController instead of instantiating one using the nib:

@implementation QuizController

- (void) loadCustomViewFromNib:(NSString *)viewNibName {
  (void)[[NSBundle mainBundle] loadNibNamed:viewNibName owner:self options:nil];
}

@end

That will cause the runtime to load the nib, but rather than creating a new view controller to connect the actions and outlets it will use what you pass in as owner. Since we pass self in the view defined in that nib will be attached to whatever IBOutlet you have it assigned to after the call.

Louis Gerbarg
Thanks that's a useful snippet
brainfsck
+4  A: 

You're on the right track. In your QuizController xib, you can create separate views by dragging them to the xib's main window rather than to the QuizController's main view. Then you can design each view you need according to your question types. When the user taps next or previous, remove the previous view and load the view you need based on your question type using -addSubview on the view controller's main view and keep track of which subview is currently showing. Trying something like this:

[currentView removeFromSuperView];

switch(questionType)
{
    case kMultipleChoice:
        [[self view] addSubview:multipleChoiceView];
        currentView = multipleChoiceView;
        break;
    case kOpenEnded:
        [[self view] addSubview:openEndedView];
        currentView = openEndedView;
        break;
// etc.
}

Where multipleChoice view and openEndedView are UIView outlets in your QuizController connected to the views you designed in IB. You may need to mess with the position of your view within the parent view before you add it to get it to display in the right place, but you can do this with calls to -setBounds/-setFrame and/or -setCenter on the UIView.

Matt Long
Thanks but I'd like to have a separate class to control the multipleChoiceView...like a ViewController but apparently that's only for entire windows.Maybe I should make a MultipleChoiceViewManager (not controller!) and set the File's Owner to that instead?
brainfsck
I think you're making it harder on yourself doing it that way. Delegation is what you have to use regardless so your decision is about where you want your code--in its own class or in the view controller class where it will be used. It's obviously up to you, but I don't think you're gaining anything by placing it in its own class. Best Regards.
Matt Long