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

Re: class variables


  • Subject: Re: class variables
  • From: Luke the Hiesterman <email@hidden>
  • Date: Tue, 6 Oct 2009 16:52:26 -0700

The canonical implementation of a singleton class uses a static to hold the singleton instance. There are other examples in Apple sample code of using class statics. So, I would say that it's not frowned upon as long as there's a good reason to do it.

Luke

On Oct 6, 2009, at 4:48 PM, Colin Howarth wrote:

Hi,

I'm coming across the odd instance where the use of a class variable would seem to make sense.

I can do this with a static definition in the class implementation file, I suppose.

Question is: is this particularly frowned upon in the Cocoa world? If so, why?

Thanks,

--colin
_______________________________________________

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

_______________________________________________

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


References: 
 >class variables (From: Colin Howarth <email@hidden>)

  • Prev by Date: class variables
  • Next by Date: Re: class variables
  • Previous by thread: class variables
  • Next by thread: Re: class variables
  • Index(es):
    • Date
    • Thread