Re: Notifications
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