Re: Calling a method on objects in an NSArray
Re: Calling a method on objects in an NSArray
- Subject: Re: Calling a method on objects in an NSArray
- From: "David Piasecki" <email@hidden>
- Date: Thu, 13 May 2004 11:04:22 -0700
That's cool. I didn't realize you could use valueForKey that way.
David
On May 13, 2004, at 11:01 AM, Allan Odgaard wrote:
On 13. May 2004, at 18:23, David Piasecki wrote:
Is it possible, as in some other languages, to call a method on all
objects in an array via one line of code (no loops)?
You can do:
[array makeObjectsPerformSelector:@selector(action)];
Or (to "collect" the results):
NSArray* res = [array valueForKey:@"action"];
_______________________________________________
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.