Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

beginSheet method not working for me

I have saveWindowController (NSWindowController subclass object). I use initWithWindowNibName: method to init the controller.
I set File's owner in xib to SaveWindowController. I connect delegate (from window) to File's owner and window (from controller) to NSWindow in xib file.

[NSApp beginSheet:[self.saveWindowController window] 
   modalForWindow:[self window]
    modalDelegate:nil didEndSelector:nil contextInfo:nil];

After executing this method I see modal window without titlebar and it appears not like normal sheet. It just appears in left bottom corner of first window.

Could you help me, what I'm doing wrong?

like image 477
Lloyd18 Avatar asked Oct 21 '11 11:10

Lloyd18


1 Answers

Do you have your SaveWindowController's window set to "Visible at Launch" in the XIB? You must uncheck that option, or your window will try to display as soon as the XIB is loaded, and will not be positioned correctly.

like image 119
Francis McGrew Avatar answered Sep 28 '22 17:09

Francis McGrew