Rick,

There's a difference in NSDocument parlance between "save", "save as", "save to", and "auto save". None of those things are "saves automatically, after a timer or notification"

You can easily implement "saves automatically". Apps like iCal simply save at the end of the event, piggy back off the NSManagedObjectContextObjectsDidChangeNotification.

Core Data has always supported Save As... style functionality, and whether you trigger a -save: invocation by a menu action, binding, timer, or notification doesn't matter.

The difference between "auto-save" and "automatically saves" is whether or not the current document is clean or dirty afterwards. An NSDocument auto-save creates a new backup document file, but does not in any way disturb the current edits that the user may be working with. Automatically saving is just flushing the current edits to disk to the main document file.

The NSManagedObjectContext simply doesn't have a way to save, but pretend like all those changes are still pending.

You could fake it by migrating the store to the backup location, creating a second context, pulling all the deltas from the original, save, and then tossing the second context.

- Ben

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to