> I'm trying to prevent NSDocument from doing any saving at all, for a demo 
> version of my app. I need to suppress the menu commands (done) and all the 
> automated UI such as the 'save changes' dialog and 'Save As' dialog even 
> though the doc is marked dirty. I've also removed the actual save code.
> 
> According to the docs for 
> -canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:, if I 
> immediately pass YES to the should close selector, it should accomplish this. 
> Indeed, it does suppress the "do you want to save changes?" dialog, but the 
> window does not close.
> 
> 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.
It sounds like you don't want to fake a save but that you want to prevent 
saving at all. What about overriding -isDocumentEdited to return NO? That will 
make sure the document is never dirty so the automatic save handling will 
remain disabled since the document does not need to be saved.
Marc

_______________________________________________

Cocoa-dev mailing list ([email protected])

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

This email sent to [email protected]

Reply via email to