• 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
Need a little help with KVC Array operators
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Need a little help with KVC Array operators


  • Subject: Need a little help with KVC Array operators
  • From: Lee Morgan <email@hidden>
  • Date: Sun, 24 Apr 2005 18:33:52 -0400

Hey list,
I need a little help with KVC Array ops. I'm trying to display a total price in a text field in IB using bindings.
I have an NSMutableArray of titles which contains an NSMutableArray of issues which has a NSDictionary that contains a NSNumber called originalPrice.
So it's setup like this

titles.issues.properties.originalPrice

What I'm trying to do is display the sum of every issue of every title in a text field.
I just can't seem to get a combination of @unionOfArrays and @sum ops to get a total for the text field.
This is what I've got working in xCode so far...

NSArray *prices = [titles valueForKeyPath:@"@unionOfArrays.issues.properties"];
NSLog(@"%@", [prices valueForKeyPath:@"@sum.originalPrice"]);

This logs the total that I'm looking for, but I just can't seem to find a way to combine those two valueForKeyPaths into one.

- lee
 _______________________________________________
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

  • Prev by Date: NSArchiver question
  • Next by Date: Re: NSArchiver question
  • Previous by thread: Re: NSArchiver question
  • Next by thread: Conceptual help with CFMessagePort/NSMessagePort
  • Index(es):
    • Date
    • Thread