Re: Deallocation while key value observers still registered
Re: Deallocation while key value observers still registered
- Subject: Re: Deallocation while key value observers still registered
- From: Roland King <email@hidden>
- Date: Wed, 26 May 2010 08:17:03 +0800
Sean McBride wrote:
On Wed, 26 May 2010 03:08:31 +1000, Gideon King said:
Glad you've tracked it down. Just a comment though: my understanding is
that calling removeObserver from dealloc is, in general, discouraged.
See here for some reasoning:
<http://www.karppinen.fi/analysistool/>
I don't believe that's actually true - although it's often stated as
fact. There's nothing in any apple documentation I've ever seen which
discourages it, if you run under GC it will even do this for you when
your objects are cleaned up.
There's a long thread on this about a year ago where we were discussing
the change in Snow Leopard to move the warning to the end of the dealloc
method. The only reason for doing that would be to allow you to remove
observers and the wording of the release note is quite persuasive.
I do this, quite often, I've never had an issue with it.
_______________________________________________
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