Re: NSDocument subclass, File Wrappers & Core Data
Re: NSDocument subclass, File Wrappers & Core Data
- Subject: Re: NSDocument subclass, File Wrappers & Core Data
- From: Matthew Johnson <email@hidden>
- Date: Mon, 18 Dec 2006 17:36:40 -0600
There is no API to inform the persistent store coordinator if the
file wrapper (and therefore the store) changes locations on disk
while the document is open. Consequently, things that you would
expect to work like NSDocument-style atomic saves and reacting to
moving the file in Finder are not possible.
Features of NSDocument that assume an in-memory document certainly
won't work in such a subclass but that is no reason to assume it isn't
possible to create a subclass of NSDocument that works slightly
differently. I have looked into it a bit and I believe there are some
nuances that you need to take into account but it does seem that it
would work as long as you take over all persistence (ex. disabling
atomic and automatic saving).
The issue of having a file moved out from under you is really a
separate issue. I'm sure it also exists with NSPersistentDocument and
I really don't see a way around that for any CoreData document-based
apps.
Matthew
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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