Re: ARC and dealloc
Re: ARC and dealloc
- Subject: Re: ARC and dealloc
- From: Jonny Yu <email@hidden>
- Date: Thu, 08 Dec 2011 09:49:22 +0800
My understanding is, due to auto release semantics, your object might be auto released again during current pool draining. So it will be put into outer Autorelease Pool, that's to say the dealloc are not guaranteed to be executed at specific timing. ARC still relies on retain/release/autorelease, so it has the same behavior.If your code must unregister notification before something else. It's better to find a more deterministic timing.
Sent from my iPhone
On 2011-12-8, at 上午4:56, Mikkel Islay <email@hidden> wrote:
> Dear list,
>
> A question regarding the proper use of dealloc in ARC-environments (under iOS):
> I have a need to unregister NSNotification observers during exchange of UiViewControllers. Is implementing - (void)dealloc considered a proper use for this purpose? Is it safe to make assumptions regarding when in the release-process dealloc is called?
>
> Incidentally, the Apple List search tool appears not to work (i.e. returns no results).
>
> Thanks,
> Mikkel Islay
>
> _______________________________________________
>
> 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
_______________________________________________
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