Core Data: binding to a sum
Core Data: binding to a sum
- Subject: Core Data: binding to a sum
- From: David Catmull <email@hidden>
- Date: Wed, 7 Apr 2010 08:14:32 -0700
How do I make a table view column show a sum calculated from Core Data Values?
I have a Budget entity with a to-many relationship of BudgetItems. In a table view listing my budgets, I want a column that displays the total of a budget's items' amounts.
I tried binding the column to email@hidden, but got this error:
Unknown.m:0: error: -[BudgetTests testBudgetSheet] : [<_NSFaultingMutableSet 0x102e28500> addObserver:forKeyPath:options:context:] is not supported. Key path: @sum.limit
..so I take it the particular NSSet variant used by Core Data doesn't support observing @sum. Or did I do that wrong?
I also tried implementing keyPathsForValuesAffectingTotal on my budget class to return "items.limit", but that didn't get me any notifications when things changed.
The next thing on my agenda is to try manually observing all changes to BudgetItems, but I'm struggling with the best way to do that.
--
David Catmull
email@hidden_______________________________________________
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