RE: question about -init methods
RE: question about -init methods
- Subject: RE: question about -init methods
- From: Vinay Prabhu <email@hidden>
- Date: Mon, 10 Jul 2006 11:17:36 +0530
- Importance: Normal
>Lots of things *can* be done. The question is, *should* it?
The *can* be done depends upon the requirement...
Instead of releasing and recreating already created object (improves the
performance, at least in my application),
one can re-use already created object. This concept is used in the "shared
object" approach.
If you know how to implement entire dealloc method, you need not call super
dealloc :-)
-----Original Message-----
From: cocoa-dev-bounces+vinayprabhu=email@hidden
[mailto:cocoa-dev-bounces+vinayprabhu=email@hidden]On
Behalf Of Matt Neuburg
Sent: Friday, July 07, 2006 10:56 PM
To: email@hidden
Subject: Re: question about -init methods
On Fri, 7 Jul 2006 18:54:59 +0530, Vinay Prabhu
<email@hidden> said:
>It can be done, provided the alloc should not be called again.
Lots of things *can* be done. The question is, *should* it?
(Example: you *can* write a dealloc method without calling super dealloc.
But don't!)
I think what I'd like to hear the OP focus on is *why* he thinks he might
need to do this. Since an instance "re-initialized back to its initial
state" would be effectively the same as a completely new instance, why not
use a completely new instance? What do you think "re-initialization" would
get you? m.
>-----Original Message-----
>From: cocoa-dev-bounces+vinayprabhu=email@hidden
>[mailto:cocoa-dev-bounces+vinayprabhu=email@hidden]On
>Behalf Of Rob Ross
>Sent: Friday, July 07, 2006 2:22 PM
>To: email@hidden
>Subject: question about -init methods
>
>
>Is is mandatory that Objective-C class instances have their
>designated initializer called only once? Can you design an
>initializer so that it can be called again to re-initialize the
>instance back to its initial state, or is that considered bad form?
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
in
This email sent to email@hidden
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s)and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender or email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden