1、alloc+init与new区别
从OC2.0开始没区别。需要注意的是数组类型的走的是 allocWithZone
---> _objc_rootAllocWithZone
-----> class_createInstance

2、Runtime如何通过Selector找到对应的IMP地址
- objc_msgSend
- methodForSelector
- method_getImplementation



- 举例说明
从OC2.0开始没区别。需要注意的是数组类型的走的是 allocWithZone
---> _objc_rootAllocWithZone
-----> class_createInstance
本文标题:iOS - Runtime面试题
本文链接:https://www.haomeiwen.com/subject/hluaeqtx.html
网友评论