• 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: Changing values of an array of objects.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing values of an array of objects.


  • Subject: Re: Changing values of an array of objects.
  • From: Jonathan Rochkind <email@hidden>
  • Date: Mon, 21 Jul 2003 10:53:21 -0500

At 04:17 PM 7/18/2003 -0500, Ricardo Strausz wrote:
Hola!

If I have an array of objects (say, nsa = displayGroup.allObjects()) and I want to change homogeneously a value in all of them (say, eo.takeValueForKey(value,key)),
can I use nsa.makeObjectsPerformSelector(takeValueForKey,{value,key}) insteed of a for() loop??

Actually, NSArray implements takeValueForKey in a wacky (yet oh so convenient) way, so you can, belive it or not, simply do:


nsa.takeValueForKey( value, key );

Not familiar with makeObjectsPerformSelector, but from the name of the method, you could probably fuss around with it to make it to the same thing with a lot more work, but not in the way you are suggesting. That won't work. But takeValueForKey should do it for you.

--Jonathan


If some one have experience in this, I will appreciate any comment.


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

References: 
 >Changing values of an array of objects. (From: Ricardo Strausz <email@hidden>)

  • Prev by Date: Re: How to really integrate WO with Dreamweaver
  • Next by Date: Re: EO does not register change with EC??
  • Previous by thread: Re: Changing values of an array of objects.
  • Next by thread: Re: Changing values of an array of objects.
  • Index(es):
    • Date
    • Thread