iOS Develop Daily Tips

iOS Daily Tip - KVO实现原理

2018-03-07  本文已影响2人  过客又见过客

这是最近被刷屏的某2018 iOS面试题列表中的一题,值得一看。

KVO在Apple中的API文档如下:

Automatic key-value observing is implemented using a technique called isa-swizzling… When an observer is registered for an attribute of an object the isa pointer of the observed object is modified, pointing to an intermediate class rather than at the true class …

KVO基本原理

具体流程如下:


1829339-77757288cc139f44.png

可加群一起交流共同学习:801216530。

上一篇 下一篇

猜你喜欢

热点阅读