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?
PreferenceModal overwrites setValue:forKey: and valueForKey: to return value of _preferences.
Cocoa's KVC is based on NSKeyValueCoding protocol, please see its reference.
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?