Re: Proper retain/release etiquette
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.