【发布时间】:2017-06-23 10:21:45
【问题描述】:
我关注this tutorial 来了解KVC。 在该教程中陈述如下
[someObject.someProperty setText:@"This is a text"];
Using KVC:
[self setValue:@"this is a text"
forKeyPath:@"someObject.someProperty.text"]
我的问题是:
1-我们在使用KVC的时候,为什么在forKeyPath中使用了“.text”?
2-does "forKeyPath" 应该总是引用我们拥有的对象,或者它可以是任何文本
【问题讨论】:
-
你了解什么是属性以及它们是如何工作的吗?
-
据我研究,KVC 是一种可以访问类属性的方法
-
我没有问过KVC。要了解 KVC,您必须了解 properties。
标签: objective-c key-value-observing kvc