Re: Crash in KVO when using -keyPathsForValuesAffecting<Key>
Re: Crash in KVO when using -keyPathsForValuesAffecting<Key>
- Subject: Re: Crash in KVO when using -keyPathsForValuesAffecting<Key>
- From: Jean-Daniel Dupas <email@hidden>
- Date: Sat, 20 Jun 2009 23:15:03 +0200
Le 20 juin 09 à 20:56, Quincey Morris a écrit :
On Jun 20, 2009, at 11:08, Jean-Daniel Dupas wrote:
- (void)dealloc {
[_object release];
[super dealloc];
}
Try changing this to:
- (void) dealloc {
self.object = nil;
[super dealloc];
}
'keyPathsForValuesAffectingName' is going to cause your wrapper to
observe its MyObject (not the observation that you set up manually,
but a different one set up internally). When the wrapper deallocs,
there's apparently nothing to cause this internal observation to be
removed, so the MyObject continues to be observed by a deallocated
object. At least, that's my theory.
Thank you for the suggestion, but it does not solve the problem. Even
trying w1.object = nil before unregistring the observer has no effect.
_______________________________________________
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