• 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: Creating new/untitled NSPersistentDocuments from template documents?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating new/untitled NSPersistentDocuments from template documents?


  • Subject: Re: Creating new/untitled NSPersistentDocuments from template documents?
  • From: Steve Mills <email@hidden>
  • Date: Fri, 01 May 2015 13:36:49 -0500

On May 1, 2015, at 13:26:26, Sean McBride <email@hidden> wrote:
>
> Hi all,
>
> I have an NSPersistentDocument-based application.
>
> I'd like to be able to create new/untitled/unsaved documents that are pre-populated with various managed objects.  Instead of creating the objects programatically, I'd like to load them from a template document (hidden inside my .app).  It's mostly working, but everything I try seems to keep some connection to the hidden template document's URL.
>
> Any suggestions on a kosher way to do this?

Can’t you just set the document’s url to nil at some point? That’s what I do in readFromURL:ofType:error: after reading the file (actually before reading, because I don’t access the url again from the document). I’m using regular NSDocument, but I’d still expect it to work with NSPersistentDocument.

--
Steve Mills
Drummer, Mac geek


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Creating new/untitled NSPersistentDocuments from template documents?
      • From: Sean McBride <email@hidden>
References: 
 >Creating new/untitled NSPersistentDocuments from template documents? (From: Sean McBride <email@hidden>)

  • Prev by Date: Creating new/untitled NSPersistentDocuments from template documents?
  • Next by Date: Re: Bindings across view controllers in OS X storyboards
  • Previous by thread: Creating new/untitled NSPersistentDocuments from template documents?
  • Next by thread: Re: Creating new/untitled NSPersistentDocuments from template documents?
  • Index(es):
    • Date
    • Thread