IOS KVC Detailed explanation
What is KVC?
KVC is nskeyvaluecoding, which is the meaning of key-value coding. An informal Protocol is a mechanism that indirectly accesses an object's properties by using a string to identify the property, rather than by invoking an access method, either directly or through an instance variable.
The above is KVC theory, interview, truthfully answer can!
Using KVC Instructions
- When KVC indirectly modifies an object's properties, it automatically determines the type of the object's properties, completing the corresponding conversion.
- KVC when a key value path is taken, if the object does not contain the specified key value, it is automatically entered inside the object to find the object properties.
- KVC can be nested according to the value of the key-value path.
What's the difference between KVC and KVO?
On an article we talked about iOS Kvo overview, interested can see. During the interview, the interviewer asked: What is the difference between KVC and KVO?
Hear this question really very (Dan) ache, Akzent want to return a sentence, how do I know what difference? Of course, if you answer like this, the interview is expected to end.
What is the difference between KVC and KVO?
KVO is built on KVC, KVO can observe the change of the KVC Key-path value of an object.
The source of this article just online: http://www.superqq.com/blog/2015/06/06/ios-kvcxiang-xi-jiang-jie/
IOS KVC Detailed explanation