• 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: "No Selection", NSObjectController & CoreData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "No Selection", NSObjectController & CoreData


  • Subject: Re: "No Selection", NSObjectController & CoreData
  • From: mmalcolm crawford <email@hidden>
  • Date: Mon, 3 Oct 2005 21:16:23 -0700


On Oct 3, 2005, at 7:54 PM, Thom Meijer wrote:

This is exactly what I was looking for. I can not help myself but it feels
quite strange to me that also NSObjectController needs the one and only
object to be added. In case of NSArrayController I pretty get it but with
*object* controller....anyway!

Sorry to be contrary, but are you sure this is what you want?
It's not entirely clear what your goal is here, but from your description it *sounds* like you want a single instance of a given entity that should be created when the application first launches and persists thereafter? Something akin to the Department created in the persistent document tutorial:
<http://developer.apple.com/documentation/Cocoa/Conceptual/ NSPersistentDocumentTutorial/04_Department/chapter_5_section_1.html#// apple_ref/doc/uid/TP40001799-CH223>
?


For a non-document-based application, you don't have the convenience of a special method that is invoked only when the document is created. Therefore, when you set up the persistence stack, you should execute a fetch request to determine whether the object already exists. If it doesn't then you should create it. (If you're creating a single store in a single location, then it may be more efficient to simply test whether the file exists when you set up the stack...)

mmalc

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: "No Selection", NSObjectController & CoreData
      • From: Thom Meijer <email@hidden>
References: 
 >Re: "No Selection", NSObjectController & CoreData (From: Thom Meijer <email@hidden>)

  • Prev by Date: Re: "No Selection", NSObjectController & CoreData
  • Next by Date: Where am I if I'm a .App package?
  • Previous by thread: Re: "No Selection", NSObjectController & CoreData
  • Next by thread: Re: "No Selection", NSObjectController & CoreData
  • Index(es):
    • Date
    • Thread