Re: Intercept Save when closing NSDocument
Re: Intercept Save when closing NSDocument
- Subject: Re: Intercept Save when closing NSDocument
- From: Uli Kusterer <email@hidden>
- Date: Sat, 11 Feb 2017 13:56:40 +0100
On 10 Feb 2017, at 18:23, Jens Alfke <email@hidden> wrote:
>
>> On Feb 10, 2017, at 9:19 AM, Keary Suska <email@hidden> wrote:
>>
>> I would start by overriding -saveDocument: and -saveDocumentAs: in your NSDocument subclass with a breakpoint so I can see what is being done.
>
> Even easier: wait for the save dialog to appear, then hit the Pause button in the debugger and look at the backtrace to see the entire call chain. Look for any NSDocument method that you can override.
That was very handy for modal dialog panels. Sadly for modeless windows and modeless sheets, I don't think this still works. If anyone has a similar trickā¦ I suppose you could try setting breakpoints in the various beginSheet calls in NSApplication/NSWindow, or maybe one on -setSheetParent: might be enough.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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