CoreData - calculations in tables?
CoreData - calculations in tables?
- Subject: CoreData - calculations in tables?
- From: Alan Dail <email@hidden>
- Date: Wed, 6 Jul 2005 01:40:03 -0400
I am building an app with CoreData and have run into a couple of issues.
I have a view with two tables, each with their own
NSArrayController. Using bindings, the content set of the 2nd
controller is the selection of the first controller. i.e. the first
table is a list of people, the 2nd list is a list of items for the
selected person. When I select a person, I can add or delete items
for that person. What I wanted to do, though, is add a column to my
table that has the number of items for each person. The first thing
I tried was to simply copy the way the # out of # display is
generated when you create a defeault core data view - i.e. I mapped a
table column to items.@count - this actually displays the item count
for each person, but does not update when items are added or removed
and caused all sorts of problems if i added items to the main list as
a result of notifications.
How should I be doing things like this. In addition to a simple
total, I'd also like to be able to do other calculations on items in
the list. For instance, if they have an attribute that is a number,
I'd like to be able to have the main list give a total amount from
summing all of the items in the sublist.
Alan
_______________________________________________
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