home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.next.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!wupost!eclnews!usenet
- From: flan@starling.wustl.edu (Ian Flanigan)
- Subject: Is @selector(foo:) constant?
- Message-ID: <1992Aug21.180854.24973@wuecl.wustl.edu>
- Keywords: @selector, Objective-C, constant
- Sender: usenet@wuecl.wustl.edu (Usenet Administrator)
- Nntp-Posting-Host: buffalo_bill
- Organization: Washington University, School of Engineering, St. Louis MO
- Date: Fri, 21 Aug 1992 18:08:54 GMT
- Lines: 24
-
- Today I was trying to manually initialize an array that would associate a bunch
- of selectors. I tried:
-
- static unsigned int my_array[][3] =
- {
- { 1, @selector(foo:), @selector(bar) },
- ...
- }
-
- The compiler came back and said:
- initializer for static variable is not constant
- So I tried making it non-static. No good. (Didn't think it would help :-) It
- therefore appears that @selector(foo:) does not generate something constant.
- Does anyone know what it _does_ generate? Anyone have a better idea than to
- use strings and sel_getUid() instead?
-
- Thanks.
-
- --
- Ian Flanigan "You can never have too many napkins."
-
- Project Zeus
- Washington University in St. Louis
- flan@starling.wustl.edu
-