Re: Creating new/untitled NSPersistentDocuments from template documents?
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