Re: SELs in arrays
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.