• 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: Vince DeMarco <email@hidden>
  • Date: Tue, 25 Sep 2001 10:55:53 -0700

On Tuesday, September 25, 2001, at 10:04 am, John C. Randolph wrote:

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)

You could also store a bunch of NSInvocations and just invoke them on whatever object you want latter.

vince


References: 
 >Re: SELs in arrays (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: SELs in arrays
  • Next by Date: Re: Drag and Drop from an app to the Finder
  • Previous by thread: Re: SELs in arrays
  • Next by thread: Re: SELs in arrays
  • Index(es):
    • Date
    • Thread