Core Data, Filtering by PopUps & Bindings Confusion
Core Data, Filtering by PopUps & Bindings Confusion
- Subject: Core Data, Filtering by PopUps & Bindings Confusion
- From: Brad Gibbs <email@hidden>
- Date: Fri, 14 Nov 2008 12:06:07 -0800
I've been using Jonathan Dann's excellent Core Data Sorted sample code
to create an outline view consisting of two concrete entities --
Categories and Types (each parent Category can have an unlimited
number of children types). The only real adjustment I've made to his
code is to put the parent relationship in the Category entity and the
children relationship in the Type entity. I've also modified the
indexPath of the addGroup method so that categories are always root
objects.
The outline view seems to be working fine. I'm using the addGroup
method to add categories and addLeaf to add types. This outline view
is in a preferences window in my app.
This section of the app is meant to be a product library. Users will
be able to sort and search by category or type. When adding a new
product, a type is assigned to the product, using the selected value
of a popup button. I'd like to limit the number of types in that
popup button by using a category popup button. In other words:
1. User indicated s/he wants to add a new product
2. User selects a category from a popbutton menu
3. App loads the selected category's types in the the types popup
button
4. User selects a type and the type is assigned to the type
relationship for the product being created or edited.
I've got two array controllers in my nib file -- one for categories
and another for types. I've tried just about every combination of
bindings I can imagine, but I can't get the types popup button to
limit itself to the types associated with the selected category -- at
best it either displays all types of every category or it populates
the types popup menu for a selected category but doesn't update itself
when a different category is selected.
Should I be using a fetch request or a filter predicate instead? If
bindings is the right approach, could someone describe the bindings
that need to be made?
Also, if there's a website, or something other than Apple's
documentation on Core Data, bindings, fetch requests and filter
predicates, I'd really appreciate the pointer. I've Googled and read
through Pragmatic Programmer's Core Data beta book, but the section on
bindings hasn't been released, yet.
Thanks in advance.
Brad
_______________________________________________
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