Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OS X View Swapping

I am developing an application which has an image and some buttons whose position remain unchanged during the entire flow. So I subclassed the NSViewController. This is the main view of my application with the fixed buttons and image. I add an NSBox item into which various subviews will be displayed and swapped in/out. How do I display the custom view on button click event in this box? I tried the following code:

    intro = [[Introduction alloc] initWithNibName:@"Introduction" bundle:nil];
    [intro setNextResponder:[self nextResponder]];
    [self setNextResponder:intro];            
    [box setContentView:[intro view]];

But I get the following error: -[NSViewController loadView] loaded the "Introduction" nib but no view was set.

The File's Owner is set to Introduction class.

like image 806
Neo Avatar asked Jun 02 '09 09:06

Neo


1 Answers

I get this error when I change the class of my File's Owner in IB.

When I get this error, I can generally fix it by remaking the connection between File's Owner and the view. Control-drag from the File's owner to your View (in IB) and select view from the pop-up menu.

like image 177
nevan king Avatar answered Oct 18 '22 22:10

nevan king