• 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
NSArray valueForKey:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSArray valueForKey:


  • Subject: NSArray valueForKey:
  • From: Victor Tsang <email@hidden>
  • Date: Tue, 6 Aug 2002 23:34:44 +0800

Hi list,

In WebObjects Foundation, sending a valueForKey: message to a NSArray
object will generate another NSArray with its elements are the results
of each element responded to the valueForKey: in the first NSArray
object.

For example,

// obj1 and obj2 are some objects
NSArray *firstArray=[NSArray arrayWithObjects:obj1, obj2];

NSArray *resultArray=[firstArray valueForKey:@"aKey"];
will give
resultArray=[NSArray arrayWithObjects:[obj1 valueForKey:@"aKey"],[obj2
valueForKey:@"aKey"]];

Is there any similar implementation in Cocoa?

Regards,

Victor Tsang
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Accessor methods and (auto)release: conclusion
  • Next by Date: Re: Accessor methods and (auto)release: conclusion
  • Previous by thread: Re: Mixing C++ and Objective-C
  • Next by thread: Keyboard support for NSScrollView with custom view?
  • Index(es):
    • Date
    • Thread