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

Re: SELs in arrays


  • Subject: Re: SELs in arrays
  • From: "John C. Randolph" <email@hidden>
  • Date: Tue, 25 Sep 2001 10:04:54 -0700

On Tuesday, September 25, 2001, at 09:48 AM, Robert S Goldsmith wrote:

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?

Don't store selectors, store strings:

SEL NSSelectorFromString(NSString *aSelectorName)
NSString *NSStringFromSelector(SEL aSelector)

-jcr

"I fear all we have done is to awaken a sleeping giant and fill him with a terrible resolve." -Admiral Isoroku Yamamoto, Dec 7, 1941.


  • Follow-Ups:
    • Re: SELs in arrays
      • From: Ondra Cada <email@hidden>
    • Re: SELs in arrays
      • From: Vince DeMarco <email@hidden>
References: 
 >SELs in arrays (From: Robert S Goldsmith <email@hidden>)

  • Prev by Date: SELs in arrays
  • Next by Date: Re: SELs in arrays
  • Previous by thread: SELs in arrays
  • Next by thread: Re: SELs in arrays
  • Index(es):
    • Date
    • Thread