[Biococoa-dev] converting from 3-letter code to 1-letter code

Charles Parnot charles.parnot at gmail.com
Wed Aug 31 18:41:58 EDT 2005


>
> Hmm, still don't see what I am doing wrong :(
>
> Why is this different from:
>
>     NSString *name = [self name];
>
>     -(NSString *) name
>     {
>         return name;
>     }
>

It just depends who 'self' is. The above code is out of context, so I  
can't tell if it is going to work. But if you use selfwithin a class  
method, then self is the class object and you are calling a class  
method. If you use self within an instance method, then self is an  
intance of the class, and you are calling an instance method.

Basically, in the code you sent, you are not creating an object  
before calling the instance method, so it will not work.

charles


--
Xgrid-at-Stanford
Help science move fast forward:
http://cmgm.stanford.edu/~cparnot/xgrid-stanford

Charles Parnot
charles.parnot at gmail.com






More information about the Biococoa-dev mailing list