Re: Storing miscellaneous singleton data in CoreData app?
Re: Storing miscellaneous singleton data in CoreData app?
- Subject: Re: Storing miscellaneous singleton data in CoreData app?
- From: Andrew Merenbach <email@hidden>
- Date: Wed, 28 May 2008 09:23:06 -0700
Hi, Rick,
It's been a while since I did this, but I had a need for the exact
thing that you are describing at one point. Basically, in my document
data model, I created another entity. This entity had whatever
properties I needed to make global. I then used an NSObjectController
(rather than any of its subclasses, such as NSArrayController,
NSDictionaryController, or NSTreeController) and fetched the object/
property when I needed it using a fetch request. As I say, it's been
a while, but it worked very well for me, especially since I had
several other properties that needed persistent storage, too.
Granted, there may be an easier way, but I can't personally think of it.
I can try to dig up my exact code, if you like. As I say, it's been a
long time, but I must have it somewhere... ;)
Cheers,
Andrew
On May 28, 2008, at 12:43 AM, Rick Mann wrote:
I have a little CoreData app that seems to work as I want it to. I
have a list in my UI and I can add and remove items to it, and a
customized detail view that displays the data for the currently-
selected item.
I also want to display some data in the detail view that is global
to the document. What's the best/easiest way to add that information
to my document and make it available to a text field via bindings?
Do I need to create additional CoreData schema? The thing is, there
should only ever be one of this global data, not many rows in a table.
TIA,
--
Rick
_______________________________________________
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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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