문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

I had a lot of trouble before realizing I declared my sheet window in IB without title bar. Does yours has one? If not, check the "title bar" option.

B.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top