window:willPositionSheet:usingRect doesn't get called
I've a Cocoa window controller defined that's overriding the method for window:willPositionSheet, but when the dialog opens it doesn't get called.
- (NSRect)window:(NSWindo开发者_如何学Gow *)window willPositionSheet:(NSWindow *)sheet usingRect:(NSRect)rect
{
return rect;
}
An important fact, the dialog is a sheet and the parent is a Carbon window passed as a Cocoa reference when the sheet dialog is created.
Any ideas?
Thanks in advance
That is an NSWindow
delegate method, so you'll need to set your window controller as the delegate of your window, either by connecting the window's delegate outlet to File's Owner in Interface Builder or by calling the window's ‑setDelegate:
method.
精彩评论