On May 12, 2009, at 12:01 PM, David Harper wrote:

Hello,

I'm finalizing an application which disallows document saving when not registered. I've put interrupts in my NSDocument subclass' - saveDocument: and -saveDocumentAs: methods so that [super ...] is only invoked if the application is registered.

However, I've just noticed that when a document is modified so that the undo stack is not empty (ie. every time the user closes a non- empty document - approximately 100% of cases) neither of these methods are called. So the trial user can successfully save by closing and choosing "Save..." in the resulting dialog. I've also interrupted -openDocument: in my MainMenuController so the user cannot open the document manually, but the modified document appears in the Open Recent submenu!

I suppose what I'm trying to ask is what method gets invoked upon a prompted save to a modified document as opposed to a manual save via the menu bar / toolbar?

The method that all direct saves funnel down to in Leopard's NSDocument architecture is:

- (void)saveDocumentWithDelegate:(id)delegate didSaveSelector: (SEL)didSaveSelector contextInfo:(void *)contextInfo


Ashley
_______________________________________________

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

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

Reply via email to