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: Nathan Zamecnik <email@hidden>
- Date: Sun, 05 May 2002 22:02:33 -0500
>
Also, I'd like a bit of clarification on one point: if I have a property
>
of a class which the class retains, when the class is released, will all
>
of its objects automatically be released as well, or must I explicitly
>
release each of them at that time?
I think you get this terminology (property) from REALbasic. In Cocoa you
would call it data member, member , member object or something similar.
Anyways, to answer your question 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];
That is why in any class you make you write a method called a destructor.
You do this simply by make an class method called -(void)release;
Inside that method just simply give the release call to any object you
allocated memory to.
-- NAteZ
_______________________________________________
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.