• 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: Problem tracking crash in iOS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem tracking crash in iOS


  • Subject: Re: Problem tracking crash in iOS
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 21 Nov 2011 12:13:42 -0800


On Nov 21, 2011, at 12:04 PM, Doug Hill wrote:

It's often that your classes can be designed such that, upon dealloc or other defined points in the object lifetime, one removes notifications. You generally don't need to query the Notification Center whether your object is registered or not as it will always need to be unregistered at dealloc.

+1. IMHO any class that registers instances with NSNotificationCenter MUST remove them in its dealloc method. Even if it already removed itself in some other method that is 100% totally guaranteed to be called first … because sometimes “100%” is really 99.44%, and 0.56% of the time you crash.

Whenever I get mysterious crashes in NSNotificationCenter, I do a quick code review of the dealloc methods of all classes that use it. This generally lets me find the problem pretty quickly.

—Jens
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Problem tracking crash in iOS (From: Matt Neuburg <email@hidden>)
 >Re: Problem tracking crash in iOS (From: Doug Hill <email@hidden>)

  • Prev by Date: Re: IPad browser app
  • Next by Date: Re: what does Open Quickly want?
  • Previous by thread: Re: Problem tracking crash in iOS
  • Next by thread: Resubmitting an app with an inApp purchase that was rejected
  • Index(es):
    • Date
    • Thread