• 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: class variables and class methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: class variables and class methods


  • Subject: Re: class variables and class methods
  • From: Robert Goldsmith <email@hidden>
  • Date: Thu, 8 Jan 2004 01:09:29 +0000

> If you need inheritance properties in class scope, do it using a class
> accessor on the static variable, ie:
>
> in .h file:
>
> + (int)myClassVariable;
>
> in .m file:
>
> static int myClassVariable = 0;
>
> + (int)myClassVariable {return myClassVariable;}

But this is the whole problem. If I then subclass this class and wish
myClassVariable to hold something different in the subclass but still
work with the inherited accessor / other methods, it won't. The
superclass's meClassVariable is used instead :(

Robert

---
GnuPG public key:
http://www.Far-Blue.co.uk

[demime 0.98b removed an attachment of type application/pgp-signature which had a name of PGP.sig]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: class variables and class methods
      • From: Michael Latta <email@hidden>
    • Re: class variables and class methods
      • From: "Louis C. Sacha" <email@hidden>
References: 
 >class variables and class methods (From: Robert Goldsmith <email@hidden>)
 >Re: class variables and class methods (From: Glenn Andreas <email@hidden>)
 >Re: class variables and class methods (From: Robert Goldsmith <email@hidden>)
 >Re: class variables and class methods (From: lbland <email@hidden>)

  • Prev by Date: Re: class variables and class methods
  • Next by Date: Re: Message.framework bugs?
  • Previous by thread: Re: class variables and class methods
  • Next by thread: Re: class variables and class methods
  • Index(es):
    • Date
    • Thread