Is there a method to find out if a class is key-value-compliant for a given key?
you can ask if it responds to the selector, or ask for the value for key
//will check for the getter
[anObj respondsToSelector:@selector(someKey)]
//will check in a way that doesn't throw an exception for a value
[andObj valueForKey:@"someKey"]
//keypath of a nested value
[anObj valueForKeypath:@"child.property"]
but if you are getting a message that something isn't KVC compliant that usually means you have set something up incorrectly, a binding with the wrong key or class for instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With