Re: NSDocument without Save
Re: NSDocument without Save
- Subject: Re: NSDocument without Save
- From: Jerry Krinock <email@hidden>
- Date: Tue, 8 Feb 2011 21:17:39 -0800
On Tue, Feb 8, 2011 at 9:29 PM, Graham Cox <email@hidden> wrote:
> What's the proper way to do this? I searched the archives but surprisingly I couldn't find any previous discussion of this, even though I would have thought it's quite a common thing.
Probably it's more common to present a sheet saying "Saving is disabled in this demo. Click this button to buy the real version…". That's easy to paste in.
> On a side note, these callbacks seem very weird - they pass the selector to call to you, but then also specify that they must be of a certain signature (document:shouldClose:contextInfo:). Isn't that a bit redundant? Or should I be building an invocation around the selector I'm given rather than assuming the signature? I tried that, and it crashes hard, so I'm guessing that's not a good idea. I don't understand why these callbacks are so convoluted instead of just asking for a simple YES or NO answer to be returned.
Indeed, the document-saving API is complicated and tricky. I learned from this:
http://www.cocoabuilder.com/archive/cocoa/153196-customizing-save-behavior-in-doc-based-apps.html?q="Don't+Save"+save+automatically#153196
Whatever you do, test it well.
_______________________________________________
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