• 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: Static in Subclasses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Static in Subclasses


  • Subject: Re: Static in Subclasses
  • From: "Hamish Allan" <email@hidden>
  • Date: Thu, 27 Mar 2008 21:05:05 +0000

On Thu, Mar 27, 2008 at 8:44 PM, Justin Giboney
<email@hidden> wrote:

>  How can I get a variable that is static to each subclass, but that is
>  declared in the super class?

In short, you can't. "static" in C means "within the scope of the
source file". Split your subclasses off into their own files, define
your static variables there, give them accessor methods, and use those
accessors in the superclass.

Hamish
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Static in Subclasses
      • From: Troy Stephens <email@hidden>
References: 
 >Static in Subclasses (From: Justin Giboney <email@hidden>)

  • Prev by Date: Re: CoreAnimation weird problems with NSView animator
  • Next by Date: Re: How to get current renderer for an NSOpenGLView?
  • Previous by thread: Re: Static in Subclasses
  • Next by thread: Re: Static in Subclasses
  • Index(es):
    • Date
    • Thread