• 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: Newbie question: autorelease sends autorelease
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie question: autorelease sends autorelease


  • Subject: Re: Newbie question: autorelease sends autorelease
  • From: Chris Ridd <email@hidden>
  • Date: Wed, 22 Sep 2004 07:50:34 +0100

On 22/9/04 7:41 am, j o a r <email@hidden> wrote:

>
> On 2004-09-22, at 08.24, Chris Ridd wrote:
>
>> That's a good question, but I can't see any reason why a dealloc method
>> would ever autorelease something in the first place. There's no point -
>> autorelease is only useful if you're returning an object to someone
>> else,
>> and by definition dealloc doesn't do that.
>
> This is not true. The ability to autorelease objects can be useful also
> in cases where you're not returning objects. Take for example the case
> with the self contained window controller that should be released after
> it's window is closed. It's customary to autorelease it on
> "windowWillClose:". Autorelease is also often used in place of release
> to be able to alloc-init-autorelease on one single row - in order to
> create code that's easier to understand, and therefore maintain.

OK, so what's the answer to the original question then? :-)

Cheers,

Chris


 _______________________________________________
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

  • Follow-Ups:
    • Re: Newbie question: autorelease sends autorelease
      • From: j o a r <email@hidden>
References: 
 >Re: Newbie question: autorelease sends autorelease (From: j o a r <email@hidden>)

  • Prev by Date: Re: How to validate NSComboBoxCell selection
  • Next by Date: Re: Newbie question: how to release an object that has been autoreleased
  • Previous by thread: Re: Newbie question: autorelease sends autorelease
  • Next by thread: Re: Newbie question: autorelease sends autorelease
  • Index(es):
    • Date
    • Thread