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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With