NSArray valueForKey:
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.