Re: Who is responsible for removing observers in longer key paths
Re: Who is responsible for removing observers in longer key paths
- Subject: Re: Who is responsible for removing observers in longer key paths
- From: Per Bull Holmen <email@hidden>
- Date: Thu, 01 Mar 2012 22:23:22 +0100
Den 21:42 1. mars 2012 skrev Quincey Morris
<email@hidden> følgende:
> No, it's nothing to do with the mutability of the parameterInfo object.
>
> The problem is likely caused by lack of KVO compliance of your key path
> either at the <parameterName> or the <attributeName> level, or both. I think
> the console message suggests a place to set a breakpoint. Set one there, and
> then look at [self observationInfo] on the object being deallocated. The
> number and classes of the observers listed should give a clue to where it's
> going wrong.
OK. I haven't thought of KVO-compliance at the <parameterName> level
because no values can change at this level. Only the controller's
parameterInfo property can change, by replacing it. That's what I
meant by calling the parameterInfo object immutable. No property
values can change for one instance of PBH_ParameterInfo class. But I
have seen some suggestions on the web (in response to others with
similar problems), that I must explicitly set each property to nil in
a KVO-compliant manner in my dealloc method. I didn't think the
problem could be at this level, but I might try that.
> Incidentally, if '[controller valueForKeyPath:
> @"parameterInfo.<parameterName>]' were invoked, what object would your
> controller return?
It would return an (immutable) NSDictionary which would be pointer
equal each time it is called for the same <parameterName>. This
dictionary would contain immutable properties for keys like
"minValue", "maxValue", etc...
Thanks for you and Keary's help. I have a few things to try out now.
Per
_______________________________________________
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