• 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
Re: Variable scope/lifetime of class methods (concerns Threads)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Variable scope/lifetime of class methods (concerns Threads)


  • Subject: Re: Variable scope/lifetime of class methods (concerns Threads)
  • From: Bill Bumgarner <email@hidden>
  • Date: Thu, 18 May 2006 08:17:22 -0700

On May 18, 2006, at 7:47 AM, Ole Voß wrote:

But what happens to the variables within a class method? What is their scope?
And what do you call them? :-))



Example:


+ (void)doSomething { NSString *test_string;

There is absolutely nothing different about this variable vs. a variable declared in an instance method or a variable declared in a C function.


It is a plain and simple local variable allocated on the stack. It follows the standard C stack based variable semantics. A quick Google search or read of K&R will exactly specify the behavior.

b.bum

_______________________________________________
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


References: 
 >Re: How to get buttonType from NSButton (From: RameshPVK <email@hidden>)
 >Re: How to get buttonType from NSButton (From: mmalcolm crawford <email@hidden>)
 >Variable scope/lifetime of class methods (concerns Threads) (From: Ole Voß <email@hidden>)
 >Re: Variable scope/lifetime of class methods (concerns Threads) (From: Ondra Cada <email@hidden>)
 >Re: Variable scope/lifetime of class methods (concerns Threads) (From: Ole Voß <email@hidden>)
 >Re: Variable scope/lifetime of class methods (concerns Threads) (From: j o a r <email@hidden>)
 >Re: Variable scope/lifetime of class methods (concerns Threads) (From: Ole Voß <email@hidden>)

  • Prev by Date: Re: BigNerdRanch Cocoa Bootcamp
  • Next by Date: Re: Variable scope/lifetime of class methods (concerns Threads)
  • Previous by thread: Re: Variable scope/lifetime of class methods (concerns Threads)
  • Next by thread: Re: Variable scope/lifetime of class methods (concerns Threads)
  • Index(es):
    • Date
    • Thread