KVC底层原理(Key-Value Coding)
一、KVC简介
KVC:键值编码,使用字符串直接访问对象的属性
常用方法
@interface NSObject(NSKeyValueCoding)
- (nullable id)valueForKey:(NSString *)key; //直接通过Key来取值
- (void)setValue:(nullable id)value forKey:(NSString *)key; //通过Key来设值
- (nullable id)va
原创
2021-06-08 17:10:04 ·
184 阅读 ·
0 评论