• 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
SELs in arrays
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SELs in arrays


  • Subject: SELs in arrays
  • From: Robert S Goldsmith <email@hidden>
  • Date: Tue, 25 Sep 2001 17:48:07 +0100

Hi :)

I have a problem that would be best solved by creating an NSArray holding a number of different objects - arrays, numbers etc. which can act as a blueprint for configuring a number of instances of a class. The problem is that part of the class instance 'blueprint' is which methods to use. Currently, these are stored in a normal C array and can change at any time so I can't just build them in or index them in any way. I need to send these SEL's along with the rest of the blueprint so would like to be able to simply add the SEL to an array. Is this possible? Can a SEL pretend to be something else? Can anyone think of another way?

For a slight background, I don't have an array of SELs and store an index because the part of the code that uses the SELs is the core of the code and runs over millions of calculations for hours at a time. Adding extra memory accesses becomes noticable over this period so I'm trying to keep the core code as lean as possible while still using the dynamic method calling (as i don't actually always know which methods are available at compile time).

At times (quite frequently) I need to read the current configuration of one instance of my class and copy the configuration (not the actual instance or any of its internal stuff) to all the other instances. I figured getting each member of the class instance that is to be copied to create an array (so that the instance itself does not have to worry about what it's member instances have in them) and then create an array from these. Then tell all the other instances to use the array (not copy it, just pass the pointer) and reconfigure themselves. But, as i said above, I need to store SEL information in there somehow.

Robert


  • Follow-Ups:
    • Re: SELs in arrays
      • From: "Erik M. Buck" <email@hidden>
    • Re: SELs in arrays
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: Text field and copy/paste...
  • Next by Date: Re: SELs in arrays
  • Previous by thread: Re: Text field and copy/paste...
  • Next by thread: Re: SELs in arrays
  • Index(es):
    • Date
    • Thread