Re: How to load from templates like in iWork using CoreData?
Re: How to load from templates like in iWork using CoreData?
- Subject: Re: How to load from templates like in iWork using CoreData?
- From: Chris Hanson <email@hidden>
- Date: Tue, 11 Oct 2005 22:37:01 -0700
On Oct 11, 2005, at 8:40 PM, E. Wing wrote:
For the moment, what seems easiest is to create a template by creating
an actual file, and then use that file as a template.
Yes, that would probably be easiest.
But what I don't know how to do is load that other file and apply all
its values to the new document.
Add (with the read-only option) the persistent store that represents
your template. Then use -[NSPersistentStoreCoordinator
migratePersistentStore:toURL:options:withType:error:] to generate the
persistent store that represents your actual document.
If you want to avoid creating a file for your new document
immediately, you can migrate to an in-memory persistent store from
the template, and then upon document save you can migrate that in-
memory store to a persistent store on disk.
-- Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden