Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/renjinkui2719/DIS_KVC_KVO
Objective-C KVC, KVO的实现源码,根据 Foundation.framework汇编反写而来,还原iOS对KVO,KVC的真实实现
https://github.com/renjinkui2719/DIS_KVC_KVO
kvc kvo
Last synced: 2 months ago
JSON representation
Objective-C KVC, KVO的实现源码,根据 Foundation.framework汇编反写而来,还原iOS对KVO,KVC的真实实现
- Host: GitHub
- URL: https://github.com/renjinkui2719/DIS_KVC_KVO
- Owner: renjinkui2719
- Created: 2017-03-01T03:23:24.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T11:23:01.000Z (about 2 years ago)
- Last Synced: 2024-08-01T19:55:20.934Z (6 months ago)
- Topics: kvc, kvo
- Language: Objective-C
- Homepage:
- Size: 3.21 MB
- Stars: 559
- Watchers: 16
- Forks: 76
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DIS_KVC_KVO
根据IOS Foundation框架汇编反写的KVC,KVO实现,可以在mac, IOS环境下运行调试, KVC与KVO实现机制密不可分,所以将它们作为一个工程。主要用作学习与研究,加深对KVC,KVO机制的理解,理解oc runtime在这些机制实现中的重要作用.
为了在xcode里正确编译调试,工程代码命名遵循一个规则:
和系统冲突的地方全部用D或者d_前缀修饰. 比如:Category `NSObject+NSKeyValueCoding`, 在工程实现中改名为`NSObject+DSKeyValueCoding`
同理:
方法 `- (id)valueForKey:(NSString *)key` ==> `- (id)d_valueForKey:(NSString *)key`方法 `- (void)addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context` ==> `- (void)d_addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context`
...类`NSKeyValueObservance` ==> `DSKeyValueObservance`
类`NSKeyValueChangeDictionary` ==> `DSKeyValueChangeDictionary`
...