Observing keyPath on NSObjectController content stops working
| Originator: | a.danmayer | ||
| Number: | rdar://28134278 | Date Originated: | 02.09.2016 |
| Status: | Open | Resolved: | |
| Product: | OSX | Product Version: | 10.12 (16A313a) |
| Classification: | API | Reproducible: | Always |
Summary: Registering observers for specific keyPaths on the content object of an NSObjectController stops working after the first time observeValueForKeyPath fires. Steps to Reproduce: I've attached a minimal demo app, which modifies some color settings as a dictionary in the user defaults. 3 checkboxes modify 3 different values (red, green, blue) in a dictionary saved as colorValues in the user defaults. I use value binding for this. I've added a User Defaults Controller and a NSObjectController (called Dictionary Controller in the app). The NSObjectController content is linked to the colorValues entry in the User Defaults Controller. The checkboxes value are then bound to the different values in the NSObjectController. Expected Results: Each change should trigger a log message in the text view. (observeValueForKeyPath should be fired for each change). Actual Results: On 10.12 it only fires once then stops working. This works on previous OSX Versions (I've tested with the latest versions of 10.9 - 10.11). Version: 10.12 Beta / 16A313a Notes: We have a very similar code in one of our products, which worked with all versions of 10.9 - 10.11 since 2015 - but stopped working with the latest beta on macOS Sierra.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!