Top "Key-value-coding" questions

Key Value Coding is a mechanism for accessing an object’s properties indirectly, using strings to identify properties, rather than through invocation of an accessor method or accessing them directly through instance variables.

Difference between objectForKey and valueForKey?

What is the difference between objectForKey and valueForKey? I looked both up in the documentation and they seemed the same …

objective-c cocoa key-value-coding
Observing an NSMutableArray for insertion/removal

A class has a property (and instance var) of type NSMutableArray with synthesized accessors (via @property). If you observe this …

cocoa key-value-observing key-value-coding
NSDictionary setValue:

OK, this is driving me nuts -- please tell me I'm not losing my mind! I declare: NSMutableDictionary* generalSettingsDict; im …

objective-c debugging key-value-observing nsmutabledictionary key-value-coding
How can I get all values for specific key from each NSDictionary in an NSArray?

I have an array which contains dictionary objects. In each dictionary the key are common. Now I want to get …

objective-c nsarray nsdictionary key-value-coding
iPhone app crashing with NSUnknownKeyException setValue:forUndefinedKey:

I'm writing my first iPhone app, so I haven't gotten around to figuring out much in the way of debugging. …

iphone xib key-value-coding
Getting array elements with valueForKeyPath

Is there any way to access an NSArray element with valueForKeyPath? Google's reverse geocoder service, for example, returns a very …

objective-c cocoa key-value-coding
Using valueForKeyPath on NSDictionary if a key starts the @ symbol?

I want to use valueForKeyPath on my NSDictionary, but the problem is that one of the keys is a string …

iphone objective-c nsdictionary key-value-coding
How do you tell if a key exists for an object using Key-Value Coding?

I'd like to test whether an object has a writeable @property in the iPhone SDK. One possible way of doing …

iphone objective-c properties key-value-coding
Directly accessing nested dictionary values in Objective-C

Is there a way to directly access an inner-array of an an outer array in Objective-C? For example, a call …

iphone objective-c dictionary nsdictionary key-value-coding
Getting string from Swift 4 new key path syntax?

How can you get a string value from Swift 4 smart keypaths syntax (e.g., \Foo.bar)? At this point I'm …

ios swift reflection swift4 key-value-coding