• 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: One more Document app style question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >One more Document app style question (From: Luther Baker <email@hidden>)

  • Prev by Date: Re: Subclassing NSWindowController in Swift
  • Next by Date: Trouble binding an NSTextField value in Swift
  • Previous by thread: One more Document app style question
  • Next by thread: How does the Swift Darwin module work?
  • Index(es):
    • Date
    • Thread