• 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: Protecting singleton objects from releasing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Protecting singleton objects from releasing


  • Subject: Re: Protecting singleton objects from releasing
  • From: Angela Brett <email@hidden>
  • Date: Sat, 15 Feb 2003 01:11:19 +1300

Is there any "recommended" way to protect singleton objects (e.g. [NSProcessInfo processInfo]) from releasing? Overriding the release method comes in mind, but I am wondering if there are better ways...

Why do you want to do that? It seems to me that if anyone releases an object, singleton or otherwise, which they have not alloced, copied or retained, is at fault for doing so. The class shouldn't be protecting client code from its own errors. If the singleton is accessed through [NSProcessInfo processInfo] or similar then it ought not be released anyway unless it's retained first, and it's not NSProcessInfo's job to police that. Or is there a more advanced concept here which I'm missing?
--
Angela Brett
email@hidden
http://acronyms.co.nz/angela
_______________________________________________
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: Protecting singleton objects from releasing
      • From: Dietrich Epp <email@hidden>
References: 
 >Protecting singleton objects from releasing (From: Georg Tuparev <email@hidden>)

  • Prev by Date: Protecting singleton objects from releasing
  • Next by Date: [SOLVED - But...] "Subclassing NSTableView while in a Java package"
  • Previous by thread: Protecting singleton objects from releasing
  • Next by thread: Re: Protecting singleton objects from releasing
  • Index(es):
    • Date
    • Thread