2

Key-Value coding of Cocoa makes get/set operation to properties simple. Anyway documentation says it only recognized pre-defined naming patterns. I think Declared Property could be supported by this feature. Actually basic access of Declared Property is just same with Key-Value coding's search pattern. The problem is custom accessor. Because the custom accessors are stored as an attribute of the property, I think it's easily possible to support them in Key-Value coding. But I can't find mention about this.

What is the regular behavior when using Key-Value coding for the Declared Properties with custom accessors?

eonil
  • 83,476
  • 81
  • 317
  • 516

1 Answers1

1

If you want to use Key-Value coding, your accessor methods must conform to specific naming conventions. In the section about (custom) accessor method names, the Objective-C Programming Language Guide specifically mentions that you "should [typically] specify accessor method names that are key-value coding compliant."

For details about which names are KVC-compliant, see Accessor Search Implementation Details in the Key-Value Coding Programming Guide.

omz
  • 53,243
  • 5
  • 129
  • 141