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

Re: Subclass


  • Subject: Re: Subclass
  • From: Sherm Pendley <email@hidden>
  • Date: Sat, 14 Jun 2003 15:39:31 -0400

On Saturday, June 14, 2003, at 04:22 AM, Sailor Quasar wrote:

3. The ability to declare static instance vars (instance vars that are part of the class object rather than of any instance of that class). If I've missed this functionality somewhere, please tell me where it is. I generally use globals to emulate it, which I personally feel is bad style.

I take advantage of a "C-ism" to more or less simulate class variables. If you declare your globals as "static", they're only visible from within the same file.

There are obviously cases where this approach breaks - more than one class declared in a file, or a class that's in several categories that are spread across multiple files, for instance. But for the simplest and most common case, where a file contains a single class, and that class is entirely defined in that file, it's adequate.

sherm--

The wise programmer is told about Tao and follows it. The average programmer is told about Tao and searches for it. The foolish programmer is told about Tao and laughs at it.

If it were not for laughter, there would be no Tao.

-- The Tao of Programming
_______________________________________________
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: Subclass
      • From: Prachi Gauriar <email@hidden>
References: 
 >Re: Subclass (From: Sailor Quasar <email@hidden>)

  • Prev by Date: Re: Cocoa's custom class delegate conventions
  • Next by Date: Re: [OT] Obj-C shortcomings (Was: Re: Subclass)
  • Previous by thread: Re: Subclass
  • Next by thread: Re: Subclass
  • Index(es):
    • Date
    • Thread