• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Intercept Save when closing NSDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Intercept Save when closing NSDocument (From: Trygve Inda <email@hidden>)
 >Re: Intercept Save when closing NSDocument (From: Keary Suska <email@hidden>)
 >Re: Intercept Save when closing NSDocument (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Optionality in a NSManagedObject sub-class
  • Next by Date: Re: Change NSCursor globally
  • Previous by thread: Re: Intercept Save when closing NSDocument
  • Next by thread: Re: Intercept Save when closing NSDocument
  • Index(es):
    • Date
    • Thread