I have been trying to create a data model class while following the NSKeyValueCoding protocol. I keep getting the following error: "Cannot find protocol declaration" And when I try to #import "NSKeyValueCoding.h" I get the file not found error.
Where can I find this protocol OR how else can it be implemented?
NSKeyValueCoding is part of Foundation. So if you #import <Foundation/Foundation.h> you already included the header.
NSKeyValueCoding is an informal protocol. That means that classes do not explicitly conform to it. On the contrary: The protocol claims that the class it is declared upon, NSObject in this case, does understand all it's methods.
So: You cannot write a (NSObject derived) class in Cocoa that does not conform to KVC.
But: You can add non KVC-compliant properties to this class, for example by using funny names for accessors. It might make sense for an implementation to follow the rules for being KVC compliant or even KVO compliant.
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