• 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: Notifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Notifications


  • Subject: Re: Notifications
  • From: Chris Hanson <email@hidden>
  • Date: Sun, 4 Mar 2007 01:11:59 -0800

On Mar 3, 2007, at 7:55 PM, Tim Horton wrote:

I'm working on a video player application, and I'm having some trouble with my QTMovieDidEndNotification.

Once in a while, it will randomly start throwing a EXEC_BAD_ACCESS from 'CallActionNotifications'... recompile, and it may or may not happen.

Does anyone know why this might happen?

If you run your software with NSZombieEnabled (from <Foundation/ NSDebug.h>) set to YES, instead of crashing, does it tell you that a deallocated object is being messaged?


When an object is deallocated, it is not automatically removed as an observer of any notifications. You need to do this in its class's override of -dealloc:

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];

    // anything else you need to release in -dealloc

    [super dealloc];
}

Obviously you also need to ensure that whatever object is acting as an observer isn't being deallocated accidentally, e.g. because it's been over-released.

  -- Chris

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >Notifications (From: Tim Horton <email@hidden>)

  • Prev by Date: Re: Subclass of NSMutableDictionary hanging
  • Next by Date: rotating an object around the center of a view
  • Previous by thread: Notifications
  • Next by thread: Connections between a text field and an instance variable do not work
  • Index(es):
    • Date
    • Thread