zorro2b zorro2b - 1 year ago 78
iOS Question

Custom cell not key value coding compliant for Runtime Attributes

I have a custom cell with an attribute called accessoryView.

From code I can do this:

NSObject* t2 = [cell valueForKey:@"accessoryView"];
NSObject* t3 = [t2 valueForKey:@"layer"];
NSObject* t4 = [t3 valueForKey:@"cornerRadius"];

All values are returned correctly.

When I add this in interface builder:


then I get a runtime error:
[ valueForUndefinedKey:]: this class is not key value coding-compliant for the key accessoryView.

I don't understand why that is the case. Is it not using the same mechanism to reference the property?

Answer Source

It's just layer.cornerRadius, you dont include the name into keypath

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download