> On 18 Oct 2014, at 17:19, Luther Baker <lutherba...@gmail.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to