Re: Core Data: binding to a sum
Re: Core Data: binding to a sum
- Subject: Re: Core Data: binding to a sum
- From: Keary Suska <email@hidden>
- Date: Wed, 7 Apr 2010 11:19:54 -0600
On Apr 7, 2010, at 9:14 AM, David Catmull wrote:
> 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?
Yes, because you are trying to observe an element of a set. Same goes for arrays. Instead, add an array controller whose content is bound to "items", and bind to arrangedObjects->@sum.limit.
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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