• 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: 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


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

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