Re: create an autorelease pool in the init-method and release it in the dealloc-method ..?
Re: create an autorelease pool in the init-method and release it in the dealloc-method ..?
- Subject: Re: create an autorelease pool in the init-method and release it in the dealloc-method ..?
- From: Nick Zitzmann <email@hidden>
- Date: Sat, 14 May 2011 22:37:24 -0600
On May 14, 2011, at 8:20 PM, Martin Batholdy wrote:
> So if I understood it correctly;
> (based on <http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmAutoreleasePools.html#//apple_ref/doc/uid/20000047-CJBFBEDI>)
> whenever I add an object to the autorelease pool or don't own the object it gets released automatically after an event cycle.
>
> is that correct?
Almost. Whenever an object is added to the autorelease pool, it gets released when that autorelease pool pops. NSApplication and UIApplication just happen to wrap their event cycles in an autorelease pool.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden