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

Singletons?


  • Subject: Singletons?
  • From: The Amazing Llama <email@hidden>
  • Date: Fri, 21 Jun 2002 00:43:45 -0700

Okay, so ObjC has no static variables.

How do you do a Singleton? What I'm seeing in code on the 'net is to make a global static variable in the .m, but this seems dangerous (someone could change it out from under you, and you can't do anything to stop them) and not at all object oriented (it's just floating out there, polluting the global namespace).

There has to be a better way... right?

-The Amazing Llama <tallama at mac dot com>
"Life is like an exploded clown. It's really funny until you figure out what just happened."
_______________________________________________
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: Singletons?
      • From: Christian Brunschen <email@hidden>
    • Re: Singletons?
      • From: Charles Jolley <email@hidden>
  • Prev by Date: RE: Outputting an unsigned long long
  • Next by Date: Re: Singletons?
  • Previous by thread: Re: NSTree ??
  • Next by thread: Re: Singletons?
  • Index(es):
    • Date
    • Thread