Re: -[NSWindow parentWindow] for sheet never works?
Re: -[NSWindow parentWindow] for sheet never works?
- Subject: Re: -[NSWindow parentWindow] for sheet never works?
- From: Quincey Morris <email@hidden>
- Date: Tue, 24 Nov 2015 09:46:04 -0800
- Feedback-id: 167118m:167118agrif8a:167118sjB99_p4RM:SMTPCORP
On Nov 24, 2015, at 08:47 , Jerry Krinock <email@hidden> wrote:
>
> In so doing, I now need the parent window in my action methods, so I can send the -[NSWindow endSheet::] message which runs the completion handler. In many cases, the sheet is handy but the parent window is not. No problem, I thought, just use send -[NSWindow parentWindow] to the sheet.
I think you’ve got hold of the wrong property. The parent window (“parentWindow”) is in relation to *child* windows (addChildWindow:ordered:), which are non-sheet windows that are related to their parents in position and functionality. The parent window in relation to *sheets* is “sheetParent”.
This property is fairly recent (10.9). IIRC in the old days you had to get the sheet parent more like your current workaround code is doing.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden