2008 03 19The perils of valueForKey:
I'm innocently reading the value of an object, with
[observedObject valueForKey:@"selection.name"]
, but getting rebuffed by the runtime :
[<NSArrayController 0x143af0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key selection.name.
Oh … I'm reading @"selection.name"
, a keyPath, not a simple key. Switching to [observedObject valueForKeyPath:@"selection.name"]
makes the headache go away.
valueForKey / valueForKeyPath
already. keys and keyPaths unite !