随笔分类 -  oc运行时

摘要:Because initialize is called in a thread-safe manner and the order of initialize being called on different classes is not guaranteed, it’s important t 阅读全文
posted @ 2020-03-12 11:02 zzfx 阅读(375) 评论(0) 推荐(0) 编辑
摘要:Github:iOS-Source-Probe 源码探求 几天前 Github 的 RetVal 大神更新了可 debug 版本的 706 <objc/runtime.h> 源码,于是让源码阅读学习得以继续。本文将介绍个人学习 load 方法的全部流程。 load 方法的调用时机 从 Effecti 阅读全文
posted @ 2020-03-11 17:26 zzfx 阅读(312) 评论(0) 推荐(0) 编辑
摘要:Objective-C is a class-based object system. Each object is an instance of some class; the object's isa pointer points to its class. That class describ 阅读全文
posted @ 2019-10-15 15:12 zzfx 阅读(220) 评论(0) 推荐(0) 编辑
摘要:按照一定规则使用匹配模式在目标空间进行搜索,然后执行相应操作; 运行时系统将kvc的运行机制解释为模式匹配,将值的兼容性问题解释为装包解包问题 一、模式匹配 The default implementation of the NSKeyValueCoding protocol provided by 阅读全文
posted @ 2019-03-27 11:50 zzfx 阅读(221) 评论(0) 推荐(0) 编辑
摘要:结论1、签名的参量类型伪造不正确会导致崩溃。 结论二、签名个数不对可能会导致参量丢失。 结论三:在签名配置正确的情况下,系统会将函数调用的所有信息打包到NSInvocation准备转发; - (void)viewDidLoad { [super viewDidLoad]; // Do any add 阅读全文
posted @ 2019-02-15 20:45 zzfx 阅读(341) 评论(0) 推荐(0) 编辑
摘要:Objective-C 的动态性是由 runtime 相关的库赋予的。 当然其他语言也完全可以运行在一个 Runtime 库上而获得动态性,由于多数高级语言的诞生都对应着一种编译器,因此将编译器的特性概括进语言里讲,也不是不可以。 http://www.cocoachina.com/ios/2016 阅读全文
posted @ 2018-09-19 16:01 zzfx 阅读(290) 评论(0) 推荐(0) 编辑
摘要:http://www.cnblogs.com/biosli/p/NSObject_inherit_2.html 函数调用 Objective-C是一门动态语言,一个函数是由一个selector(SEL),和一个implement(IML)组成的。Selector相当于门牌号,而Implement才是 阅读全文
posted @ 2017-07-25 10:41 zzfx 阅读(269) 评论(0) 推荐(0) 编辑
摘要:struct objc_method { SEL _Nonnull method_name OBJC2_UNAVAILABLE; char * _Nullable method_types OBJC2_UNAVAILABLE; IMP _Nonnull method_imp OBJC2_UNAVAI 阅读全文
posted @ 2017-06-15 18:51 zzfx 阅读(535) 评论(0) 推荐(0) 编辑