I'm building a framework in Xcode, and I need to display a window when a function is called. How do I get my framework to display a window that I build in Interface Builder? Step by step instructions would be greatly appreciated!
Thanks, Chetan
You'd call it like this:
MyWindowController* controller = [[MyWindowController alloc]
initWithWindowNibName:@"Foo"];
[controller showWindow:nil];
Where Foo is the name of the nib file, and MyWindowController
is a subclass of NSWindowController that you set to be the owner of the nib file.
In this case, it's important to subclass NSWindowController because it will automatically search for the nib file within the bundle that the class lives in.
Use an NSWindowController
as the window's File's Owner, and then just call [myWindowController showWindow:nil]
.
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