• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to load from templates like in iWork using CoreData?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to load from templates like in iWork using CoreData?
      • From: "E. Wing" <email@hidden>
References: 
 >How to load from templates like in iWork using CoreData? (From: "E. Wing" <email@hidden>)

  • Prev by Date: Re: What's the magic that makes cmd-w close a window?
  • Next by Date: Re: awakeFromNib not called
  • Previous by thread: How to load from templates like in iWork using CoreData?
  • Next by thread: Re: How to load from templates like in iWork using CoreData?
  • Index(es):
    • Date
    • Thread