home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / next / programm / 5738 < prev    next >
Encoding:
Text File  |  1992-08-21  |  1.2 KB  |  37 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!wupost!eclnews!usenet
  3. From: flan@starling.wustl.edu (Ian Flanigan)
  4. Subject: Is @selector(foo:) constant?
  5. Message-ID: <1992Aug21.180854.24973@wuecl.wustl.edu>
  6. Keywords: @selector, Objective-C, constant
  7. Sender: usenet@wuecl.wustl.edu (Usenet Administrator)
  8. Nntp-Posting-Host: buffalo_bill
  9. Organization: Washington University, School of Engineering, St. Louis MO
  10. Date: Fri, 21 Aug 1992 18:08:54 GMT
  11. Lines: 24
  12.  
  13. Today I was trying to manually initialize an array that would associate a bunch  
  14. of selectors.  I tried:
  15.  
  16. static unsigned int my_array[][3] =
  17. {
  18.    { 1, @selector(foo:), @selector(bar) },
  19.    ...
  20. }
  21.  
  22. The compiler came back and said:
  23.    initializer for static variable is not constant
  24. So I tried making it non-static.  No good.  (Didn't think it would help :-)  It  
  25. therefore appears that @selector(foo:) does not generate something constant.   
  26. Does anyone know what it _does_ generate?  Anyone have a better idea than to  
  27. use strings and sel_getUid() instead?
  28.  
  29. Thanks.
  30.  
  31. --
  32. Ian Flanigan        "You can never have too many napkins."
  33.  
  34. Project Zeus
  35. Washington University in St. Louis
  36. flan@starling.wustl.edu
  37.