Chapter 11. Key-Value Coding and NSPredicate
This chapter covers
KVC is a feature of the Foundation framework that allows you to access the properties of an object using strings. To obtain the current value of an object’s property, you usually send the object an explicit getter message, as demonstrated here:
Given an instance of the CTRentalProperty class developed in chapter 5, this would return the current value of the house’s address property. In Objective C 2.0 you could also use the following alternative property accessor syntax:
When using either syntax, it isn’t possible at runtime to change which property is accessed, because the property name is explicitly hardcoded into the source code. You can work around this potential problem by using an if statement: