• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Variable scope/lifetime of class methods (concerns Threads)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Variable scope/lifetime of class methods (concerns Threads)
      • From: Ondra Cada <email@hidden>
References: 
 >Re: How to get buttonType from NSButton (From: RameshPVK <email@hidden>)
 >Re: How to get buttonType from NSButton (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: How to get buttonType from NSButton
  • Next by Date: Re: How to get buttonType from NSButton
  • Previous by thread: Re: How to get buttonType from NSButton
  • Next by thread: Re: Variable scope/lifetime of class methods (concerns Threads)
  • Index(es):
    • Date
    • Thread