Re: Filling a drawer (Core Data and a newbie problem)
Re: Filling a drawer (Core Data and a newbie problem)
- Subject: Re: Filling a drawer (Core Data and a newbie problem)
- From: Quincey Morris <email@hidden>
- Date: Thu, 13 May 2010 12:31:13 -0700
On May 13, 2010, at 10:25, Paul Johnson wrote:
> In applicationDidFinishLaunching: I have set up the Managed Object Context.
> I've initialized the Persistent Store Coordinator, read the .mom file, and
> near as I can tell I've set everything up as I'm supposed to.
>
> Now in Interface Builder I'm trying to set up the Bindings so the data gets
> read from memory and displayed when I open the drawer.
The answer depends on what "the data" is. Typically, there are three possibilities:
1. You're trying to display all the objects in a one-to-many relationship. In that case, create a NSArrayController in your XIB file, configure it for "entity" mode and bind its content set to the relationship.
2. You're trying to display only some objects in a one-to-many relationship. Do the same as #1, but also specify a fetch predicate for the array controller.
3. You're trying to display some other collection of managed objects. In that case, create an array controller in "class" mode, and bind its content to an array property of File's Owner. Have your code initially load and subsequently maintain this array property KVO-compliantly.
In any of the cases, you can also use sort descriptors or filter predicates on the array controller if necessary.
Does that get you any closer to your goal?
_______________________________________________
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