Re: overloading release
Re: overloading release
- Subject: Re: overloading release
- From: Scott Anguish <email@hidden>
- Date: Tue, 27 Dec 2005 18:42:57 -0500
you should not do this here, instead do it in the -dealloc method
if you just implement dealloc, everything else release wise takes
care of itself.
On Dec 27, 2005, at 6:41 PM, David Alter wrote:
I just wondering if it is a bad idea to over load release. I have
an object that on init allocates a NSMutableArray. So I was
thinking on release I should make sure I deallocated it. Kind of
simulating distructors in C++. Here is a sample of what I'm doing.
- (oneway void)release
{
if ([self retainCount] == 1)
{
[data release];
}
[super release];
}
- (id)init
{
[super init];
data = [[NSMutableArray alloc] init];
return self;
}
_______________________________________________
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