attgm / kotonoko

EB Library Interface for Mac OS X
Other
29 stars 1 forks source link

Observing PreferenceModal #1

Open godzillabytes opened 11 years ago

godzillabytes commented 11 years ago

There are several functions that want to observe PreferenceModal via addObverver, As far as I can see the values for "forKeyPath" cannot be correct for PreferenceModal objects, because the keys they are refering to are acually inside the member variable NSMutableDictionary* _preferences. What I mean, for example, that there is no kContentsFont (@"contentsFont") as a key in PreferenceModal but inside _preferences. Maybe _preferences needs to be a property, so that the keyPath could then be "preferences.contentsFont"? It might be that I am wrong, maybe you can correct me?

Is this implemented through the setValue and valueForKey methods in PreferencesModal?

attgm commented 11 years ago

PreferenceModal overwrites setValue:forKey: and valueForKey: to return value of _preferences. Cocoa's KVC is based on NSKeyValueCoding protocol, please see its reference.