I have a xib file with only an NSPanel in it, I'm trying to show this panel as modal sheet (with beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:
). The file's owner for this xib is a controller class "MyController" which has the IBOutlet to the NSPanel.
What I am looking for is something like:
...
MyController *controller = [[MyController alloc] init];
[NSApp beginSheet:controller.panel modalForWindow:[NSApp mainWindow] modalDelegate:controller didEndSelector:nil contextInfo:nil];
...
Question:
Must MyController inherit from NSWindowController
or NSObject
?. I tried NSWindowController
and initWithWindowNibName:
but the outlet to NSPanel
always is nil.
Thanks