• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Retain, then autorelease and then release does what?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Retain, then autorelease and then release does what?
      • From: Ondra Cada <email@hidden>
    • Re: Retain, then autorelease and then release does what?
      • From: "Erik M. Buck" <email@hidden>
References: 
 >Retain, then autorelease and then release does what? (From: Joel Rosenblum <email@hidden>)

  • Prev by Date: Current application
  • Next by Date: Write to a text file
  • Previous by thread: Re: Retain, then autorelease and then release does what?
  • Next by thread: Re: Retain, then autorelease and then release does what?
  • Index(es):
    • Date
    • Thread