• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Core Data: binding to a sum
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Core Data: binding to a sum
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: NSPrintSavePath not working correctly?
  • Next by Date: Re: exceptions when NSTextStorage initialized with empty string
  • Previous by thread: Correct way to manage drag-delete cursor?
  • Next by thread: Re: Core Data: binding to a sum
  • Index(es):
    • Date
    • Thread