• 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
Re: Calculating a total from a collection of numeric attributes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculating a total from a collection of numeric attributes


  • Subject: Re: Calculating a total from a collection of numeric attributes
  • From: "I. Savant" <email@hidden>
  • Date: Sun, 18 Oct 2009 10:45:27 -0400

On Oct 17, 2009, at 7:40 PM, Ian Piper wrote:

I have a Core Data entity that has an attribute called charge (stored as a float). So I am storing a number of records each of which has a charge. I simply want to be able to show a running total of charges as I add or remove items. I was hoping that I might be able to use a simple binding for this: I created a label and thought I might be able to bind its value to array controller.arrangedObjects.charge.sum or something like that. No luck though.

I cannot see anything in the documentation or from searches. Can anyone point me towards either examples or documentation?

You want set and array operators:

http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/ArrayOperators.html

You really should read the KVC, KVO, Bindings, and Core Data guides front to back since there are terms you wouldn't otherwise know to search for. It's best to know you read about something but forget the specifics then to not read it at all and have no idea. :-)

--
I.S.


_______________________________________________

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: Calculating a total from a collection of numeric attributes
      • From: Ian Piper <email@hidden>
References: 
 >Calculating a total from a collection of numeric attributes (From: Ian Piper <email@hidden>)

  • Prev by Date: Re: Why does my font come out looking fuzzy?
  • Next by Date: Curious about SSH
  • Previous by thread: Calculating a total from a collection of numeric attributes
  • Next by thread: Re: Calculating a total from a collection of numeric attributes
  • Index(es):
    • Date
    • Thread