Variable scope/lifetime of class methods (concerns Threads)
Variable scope/lifetime of class methods (concerns Threads)
- Subject: Variable scope/lifetime of class methods (concerns Threads)
- From: Ole Voß <email@hidden>
- Date: Thu, 18 May 2006 09:45:24 +0200
Hi everybody,
I've been playing with the thread example from the Book 'Cocoa
Programming' (Sams). Working with one thread everything is fine, but as
soon as I try setting up two threads I run into problems with the
variables in the class method which starts the NSRunLoop for that thread.
Basically I understand that a class method is only 'instantiated'
(so-to-say) once for all objects that are created using this class. What
I'm unsure about is what happens to the variables that are used within a
class method? It appears that these are also created only once...
I've probably answered the question myself, but maybe somebody could
give me a hint as to where I can read more about this topic, or what I'm
missing or should do further reading on. I've read so many documents in
the past three weeks that I'm a little overloaded on information :-))
Thanks!
Ole.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden