Search code examples
iosstoryboardinterface-builderkvc

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:

KVC

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?


Solution

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