Re: One more Document app style question
Re: One more Document app style question
- Subject: Re: One more Document app style question
- From: Mike Abdullah <email@hidden>
- Date: Sun, 19 Oct 2014 10:36:07 +0100
> On 18 Oct 2014, at 17:19, Luther Baker <email@hidden> wrote:
>
> Coming from an iOS background, I'm used to seeing (and encapsulating) the
> creation of key Core Data components (persistent store, location,
> contexts). Everything is pretty explicit and consequently easy to follow.
>
> When I use Xcode to generate a desktop Document based app for me, that
> functionality is hidden from me. No problem ... but, I don't like the class
> name "Document" - I'd like to change it so something specific ...
> "MyAppDocument". Maybe that is easy enough ... but then there's the
> Document.xib file ... and Document.xcdatamodel.
>
> So, how does the app specific Document class know which datamodel to
> instantiate? Is the rule simply that the name of the NSDocument's subclass
> must match the name of the datamodel file (similar to the default behavior
> for xib matching)? -- or is there something I need to update in the plist
> file as well?
Have a look at the docs for -[NSPersistentDocument managedObjectModel] to answer this one
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSPersistentDocument_Class/index.html#//apple_ref/occ/instm/NSPersistentDocument/managedObjectModel
_______________________________________________
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