From: flan@starling.wustl.edu (Ian Flanigan)
Subject: Re: Is @selector(foo:) constant?
Keywords: 3.0, selector, IB, NeXTStep, Objective-C, objc
Organization: Washington University, School of Engineering, St. Louis MO
Date: Mon, 31 Aug 1992 19:36:47 GMT

In article <mdixon.714778520@thelonius> mdixon@parc.xerox.com (Mike  
Dixon) writes:
>  ** 3.0 Incompatibility Alert! **
>  
>  a few days ago i wrote:
>  
>      the trick is that although @selector(foo:) isn't constant,
>      &@selector(foo:) is.  initialize your array with the addresses  
of
>      the selectors, and remember to dereference them before you use
>      them.
>  
>  while this was true in 2.0, a new version of the TextORama  
MiniExample
>  that appeared today in the archives suggests that it's no longer  
true
>  in 3.0 (i'm not a beta tester, so i can't confirm it).  it appears
>  that even the addresses of @selector expressions are no longer
>  constant; to make this kind of code work in 3.0 you'll have to  
build
>  the array at runtime (with calls to sel_getUid -- see the new
>  TextORama for details).

Well, I just wrote and ran a small test program.  It seems that  
&@selector(foo) is still constant.  (Yeah!)  I used NS3.0 PR2, but I  
suspect that it's the same across all of 'em.

If you want to try it for yourself, here's a small bit-o-program for  
ya:
mytest.tar.Z :  

--
Ian Flanigan		"You can never have too many napkins."

Project Zeus
Washington University in St. Louis
flan@starling.wustl.edu


-- NewsGrazer, a NeXTstep(tm) news reader, posting --
M>UQR=&8P7&%N<VE[7&9O;G1T8FQ<9C!<9FUO9&5R;B!#;W5R:65R.WT*7&UA
M<F=L,3(P"EQM87)G<C$R,`I<<&%R9%QT>#DV,%QT>#$Y,C!<='@R.#@P7'1X
M,S@T,%QT>#0X,#!<='@U-S8P7'1X-C<R,%QT>#<V.#!<='@X-C0P7'1X.38P
M,%QF,%QB,%QI,%QU;#!<9G,R-"!);B!A<G1I8VQE(#QM9&EX;VXN-S$T-S<X
M-3(P0'1H96QO;FEU<SX@;61I>&]N0'!A<F,N>&5R;W@N8V]M("A-:6ME($1I
M>&]N*2!W<FET97,Z7`H^("`J*B`S+C`@26YC;VUP871I8FEL:71Y($%L97)T
M(2`J*EP*/B`@7`H^("!A(&9E=R!D87ES(&%G;R!I('=R;W1E.EP*/B`@7`H^
M("`@("`@=&AE('1R:6-K(&ES('1H870@86QT:&]U9V@@0'-E;&5C=&]R*&9O
M;SHI(&ES;B=T(&-O;G-T86YT+%P*/B`@("`@("9`<V5L96-T;W(H9F]O.BD@
M:7,N("!I;FET:6%L:7IE('EO=7(@87)R87D@=VET:"!T:&4@861D<F5S<V5S
M(&]F7`H^("`@("`@=&AE('-E;&5C=&]R<RP@86YD(')E;65M8F5R('1O(&1E
M<F5F97)E;F-E('1H96T@8F5F;W)E('EO=2!U<V5<"CX@("`@("!T:&5M+EP*
M/B`@7`H^("!W:&EL92!T:&ES('=A<R!T<G5E(&EN(#(N,"P@82!N97<@=F5R
M<VEO;B!O9B!T:&4@5&5X=$]286UA($UI;FE%>&%M<&QE7`H^("!T:&%T(&%P
M<&5A<F5D('1O9&%Y(&EN('1H92!A<F-H:79E<R!S=6=G97-T<R!T:&%T(&ET
M)W,@;F\@;&]N9V5R('1R=65<"CX@(&EN(#,N,"`H:2=M(&YO="!A(&)E=&$@
M=&5S=&5R+"!S;R!I(&-A;B=T(&-O;F9I<FT@:70I+B`@:70@87!P96%R<UP*
M/B`@=&AA="!E=F5N('1H92!A9&1R97-S97,@;V8@0'-E;&5C=&]R(&5X<')E
M<W-I;VYS(&%R92!N;R!L;VYG97)<"CX@(&-O;G-T86YT.R!T;R!M86ME('1H
M:7,@:VEN9"!O9B!C;V1E('=O<FL@:6X@,RXP('EO=2=L;"!H879E('1O(&)U
M:6QD7`H^("!T:&4@87)R87D@870@<G5N=&EM92`H=VET:"!C86QL<R!T;R!S
M96Q?9V5T56ED("TM('-E92!T:&4@;F5W7`H^("!497AT3U)A;6$@9F]R(&1E
M=&%I;',I+EP*7`I796QL+"!)(&IU<W0@=W)O=&4@86YD(')A;B!A('-M86QL
M('1E<W0@<')O9W)A;2X@($ET('-E96US('1H870@)D!S96QE8W1O<BAF;V\I
M(&ES('-T:6QL(&-O;G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