108

iOS底层原理总结 - 关联对象实现原理 - 简书

 5 years ago
source link: https://www.jianshu.com/p/0f9b990e8b0a?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
面试题 Category能否添加成员变量?如果可以,如何给Category添加成员变量?答:不能直接添加成员变量,但是可以通过runtime的方式间接实现添加成员变量的效果。 RunTime为Category动态关联对象 使用RunTime给系统的类添加属性,首先需要了解对象与属性的关系。我们通过之前的学习知道,对象一开始初始化的时候其属性为nil,给属性赋值其实就是让属性指向一块存储内容的...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK