Re: SELs in arrays
Re: SELs in arrays
- Subject: Re: SELs in arrays
- From: Ondra Cada <email@hidden>
- Date: Tue, 25 Sep 2001 20:05:57 +0200
John,
>
>>>>> John C. Randolph (JCR) wrote at Tue, 25 Sep 2001 10:04:54 -0700:
JCR> >possible? Can a SEL pretend to be something else? Can anyone think of
JCR> >another way?
JCR>
JCR> Don't store selectors, store strings:
JCR>
JCR> SEL NSSelectorFromString(NSString *aSelectorName)
JCR> NSString *NSStringFromSelector(SEL aSelector)
Agreed that it's the most flexible way, but also the most inefficient one. I
would store them in numbers:
[array addObject:[NSNumber numberWithInt:@selector(whatever)]];
...
[anObject performSelector:[[array objectAtIndex:n] intValue] ...]
I guess it would be cleaner using NSValue, but I'm just used to the integers ;)))
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc