One, KVC is the key/value code.
Second, the basic invocation of KVC includes-valueforkey: and-setvalue:forkey:.
Third, for Kvc,cocoa automatically put and remove scalar values. That is, when Setvalueforkey is used, it automatically places scalar values (Int,float and structs) into NSNumber and Nsvavlue, and when-setvalueforkey is used, it automatically takes a scalar value out of those objects. Only KVC has this automatic packing function. General method calls and property syntax do not have this capability.
Four, KVC is not free.
KVC can handle collections very easily. So why not use KVC to process all objects, and discard access methods and code writing? There's no free lunch unless you work for a big tech company in Silicon Valley. KVC needs to parse the string to calculate the answer you need, so it is slow and the compiler is not able to check it incorrectly. You may want to handle [email protected]:, but the compiler cannot tell if it is the wrong key path. Therefore, when you try to use it, a run-time error occurs.
Reference: "Objective-c Basic Course"
"Reading notes" IOS-KVC