KVC

2018-07-12  本文已影响2人  伶俐ll

一、KVC的原理(赋值取值过程)

- (void)setValue:(nullable id)value forKey:(NSString *)key;
- (void)setValue:(nullable id)value forKeyPath:(NSString *)keyPath;
- (nullable id)valueForKey:(NSString *)key;
- (nullable id)valueForKeyPath:(NSString *)keyPath;
@property (class, readonly) BOOL accessInstanceVariablesDirectly;

二、通过KVC会触发KVO吗

会触发KVO

上一篇 下一篇

猜你喜欢

热点阅读