Re: Retain, then autorelease and then release does what?
Re: Retain, then autorelease and then release does what?
- Subject: Re: Retain, then autorelease and then release does what?
- From: Ondra Cada <email@hidden>
- Date: Mon, 6 May 2002 13:50:53 +0200
On Monday, May 6, 2002, at 05:02 , Nathan Zamecnik wrote:
anytime you create an object like :
MyObjectInstance = [[myObject alloc]init];
It is your job to at some time make sure that object is sent:
[myObjectInstance release];
Right.
That is why in any class you make you write a method called a destructor.
Right, though the name "destructor" is not generally used in ObjC/Cocoa.
You do this simply by make an class method called -(void)release;
Wrong: the method is called "dealloc". You, as a newbie, NEVER EVER
reimplement release.
Inside that method just simply give the release call to any object you
allocated memory to.
Plus any object you retained (minus any object you released before, but
that's obvious).
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.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.