Re: tearing my hair out: +(NSSet *)keyPathsForValuesAffectingValueForKey:
Re: tearing my hair out: +(NSSet *)keyPathsForValuesAffectingValueForKey:
- Subject: Re: tearing my hair out: +(NSSet *)keyPathsForValuesAffectingValueForKey:
- From: Chris Idou <email@hidden>
- Date: Wed, 15 Oct 2008 17:46:49 -0700 (PDT)
I can't do that because my object inherits from NSObject, and NSObject doesn't contain an implementation of observeValueForKeyPath. So that gives a runtime error.
Besides which, the only reason I added observeValueForKeyPath method is because keyPathsForValuesAffecting wasn't working.
--- On Wed, 10/15/08, Ken Thomases <email@hidden> wrote:
> From: Ken Thomases <email@hidden>
> Subject: Re: tearing my hair out: +(NSSet *)keyPathsForValuesAffectingValueForKey:
> To: email@hidden
> Cc: email@hidden
> Date: Wednesday, October 15, 2008, 5:42 PM
> On Oct 15, 2008, at 7:16 PM, Chris Idou wrote:
>
> > For one of my attributes I can't seem to get
> > keyPathsForValuesAffecting<Key> to do its thing.
> The following is my
> > code. I'm observing both keys to try and find out
> what's going on.
> > keyPathsForValuesAffectingCanLink does get called.
> > observeValueForKeyPath gets called for key
> > noteController.linkableSelection, but it never gets
> called for
> > "canLink".
> >
> > Shouldn't the existance of
> keyPathsForValuesAffectingCanLink mean
> > that every time the observer gets triggered for
> > noteController.linkableSelection that it also gets
> triggered for
> > canLink? Is there any circumstances it wouldn't?
> Tearing my hair out!
> >
> > [...]
> >
> > - (void)observeValueForKeyPath:(NSString *)keyPath
> > ofObject:(id)object
> > change:(NSDictionary *)change
> > context:(void *)context {
> > NSLog(@"oVFKP: %@", keyPath);
>
> Does it help to invoke super's implementation here?
>
> > }
>
> Cheers,
> Ken
_______________________________________________
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