• 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: Deallocation while key value observers still registered
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Deallocation while key value observers still registered (From: Roland King <email@hidden>)
 >Re: Deallocation while key value observers still registered (From: aglee <email@hidden>)
 >Re: Deallocation while key value observers still registered (From: Kyle Sluder <email@hidden>)
 >Re: Deallocation while key value observers still registered (From: Gideon King <email@hidden>)
 >Re: Deallocation while key value observers still registered (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: Layer-hosting views and layer-backed scroll views
  • Next by Date: UITabBar as a UISegmentedControl???
  • Previous by thread: Re: Deallocation while key value observers still registered
  • Next by thread: Re: Deallocation while key value observers still registered
  • Index(es):
    • Date
    • Thread