I need to create an modal dialog, which is to loaded from a nib file and should be displayed on a button click in the main window.
I can create a custom window in a nib file and load the custom dialog on button click, but it's not a modal dialog. I can switch back to the main window.
MyWindowController
is the NSWindowController
subclass.
I used the code below to display my window in response to the button event:
MyWindowController *pController = [[MyWindowController alloc]
initWithWindowNibName:@"nibfilename"];
[MyWindowController showWindow:self];