> On Feb 10, 2017, at 9:12 AM, Trygve Inda <cocoa...@xericdesign.com> wrote:
> 
> When I close an NSDocument, it puts up a sheet offering (DonĀ¹t Save,
> Cancel, Save).
> 
> Is there a way to intercept this? I would like to disable the Save button
> for a demo version of our app. I could mark the document as having no
> changes, but then it would just close directly and not allow a cancel
> operation.
> 
> I can easily disable the menu Save/Save As but clicking the Save button in
> the close-sheet window jumps right into the file writing methods in my
> NSDocument subclass.
> 
> Thanks for any ideas.

I would start by overriding -saveDocument: and -saveDocumentAs: in your 
NSDocument subclass with a breakpoint so I can see what is being done. I might 
also start by subclassing 
-runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo: to see 
if that is the method used in these cases. Then there are also autosave issues 
if you intend to support autosave in your app...

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to