bugGNUstep - Bugs: bug #41325, KVO: +[NSObject...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #41325: KVO: +[NSObject keyPathsForValuesAffecting<Key>] not supported

Submitted by:  Frederik <triplef>
Submitted on:  Thu 23 Jan 2014 06:18:36 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: NoneStatus: In Progress
Privacy: PublicAssigned to: None
Open/Closed: Open

Sun 26 Jan 2014 01:52:18 PM UTC, comment #3:

Thank you for spotting this bug. I committed you suggested fix.

As for the real change I hope that Richard is taking this up, I might put it in the wrong place.

Fred Kiefer <FredKiefer>
Project Member
Sun 26 Jan 2014 01:46:24 PM UTC, comment #2:

Thanks for the quick fix. Your suggestion about calling -keyPathsForValuesAffectingXXX: when registering an observer sounds like a good solution to me, as the result from these methods is unlikely to change and Apple doesn’t document at which times/intervals they are called either.

One thing I noticed in your change - I think 'dependentKey' should be capitalized here (i.e. [dependentKey capitalizedString]):

> NSString *selString = [NSString stringWithFormat: @"keyPathsForValuesAffecting%@",

dependentKey];

Frederik <triplef>
Sun 26 Jan 2014 01:30:37 PM UTC, comment #1:

I just implemented the method keyPathsForValuesAffectingValueForKey, but the result may not be as expected.

The current implementation of KVO in GNustep does not call this method when a key gets observed to determine which which key paths affect which others. I think fixing this would require an almost complete rewrite of the KVO implementation.

What we could do to get a similar result would be to add calls to the keyPathsForValuesAffectingXXX: methods when a new observer gets added and fix the values in dependentKeyTable to reflect those connections.

Fred Kiefer <FredKiefer>
Project Member
Thu 23 Jan 2014 06:18:36 PM UTC, original submission:

This is a kind request to add support for +keyPathsForValuesAffecting<Key> / +keyPathsForValuesAffectingValueForKey: on NSObject.

Currently only the older +setKeys:triggerChangeNotificationsForDependentKey: is supported to register dependent keys, which Apple deprecated in OS X 10.5.

Thanks!

Frederik <triplef>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by FredKiefer (Posted a comment)
  • -unavailable- added by triplef (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 26 Jan 2014 01:30:37 PM UTCFredKieferStatusNone=>In Progress

    Back to the top


    Powered by Savane 3.1-cleanup