swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is "static" meaningful in Objective-C methods?


From: Marcus G. Daniels
Subject: Re: Is "static" meaningful in Objective-C methods?
Date: 01 Nov 2000 14:39:06 -0800
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "PJ" == Paul E Johnson <address@hidden> writes:

PJ> Is there any danger in using "static" local variables in methods
PJ> in Objective-C?

If the goal is to have state shared by all instances of class in
a particular method, then it is what you want.  

PJ> But I've not seen this in Swarm examples, and wonder if
PJ> there is a danger of class instances corrupting or accidentally
PJ> using each other's values for static variables.

Yes, that is exactly how it will behave.  But if you want that
behavior, you want it.

PJ> Using this in Swarm would let me get rid of a bunch of IVARS that hold
PJ> values of seldom-used methods, so I could clean up some code. 

It seems fishy that an instance variable would ever be changed to static
state, since one is local to an object and the other modifies the
behavior of any object that calls the method.

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]