• 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: Proper retain/release etiquette
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper retain/release etiquette


  • Subject: Re: Proper retain/release etiquette
  • From: Ondra Cada <email@hidden>
  • Date: Thu, 25 Jul 2002 16:26:08 +0200

On Thursday, July 25, 2002, at 06:03 , Daryn wrote:

I can understand how re-initing an object, in general, would be a terrible practice. What about in controlled situations where the scope of the reinited variable is limited? For example, might a loop benefit from reiniting a string object repeatedly to save on object creation/destruction overhead?

So is it a frowned upon practice, or are there technical issues?

Generally, init is not written so that it can be used more times: with majority of NeXT-made, Apple-made, and 3rd party classes, it would leak; with some, it would crash or just malfunction.

OTOH, there is no technical problem at all for you to define your own inits inyour classes so that multiple init is safe, and use them that way.
I would personally rather recommend *not* using the name -init... for this message just to be consistent, but it is not really important (provided your documentation is good).
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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.
References: 
 >Re: Proper retain/release etiquette (From: Daryn <email@hidden>)

  • Prev by Date: Re: double click call textedit
  • Next by Date: Re: What is the purpose of static typing?
  • Previous by thread: Re: Proper retain/release etiquette
  • Next by thread: Re: Proper retain/release etiquette
  • Index(es):
    • Date
    • Thread