opensubscriber
   Find in this group all groups
 
Unknown more information…

c : cocoa-dev@lists.apple.com 28 December 2005 • 7:41AM -0500

overloading release
by David Alter

REPLY TO AUTHOR
 
REPLY TO GROUP




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;
}

Thanks for the help
-dave

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (Cocoa-dev@list...)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/subscriber%40opensubscriber.com

This email sent to subscriber@open...

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.