Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

内存布局 #1

Open
Deeer opened this issue Jul 29, 2018 · 2 comments
Open

内存布局 #1

Deeer opened this issue Jul 29, 2018 · 2 comments

Comments

@Deeer
Copy link

Deeer commented Jul 29, 2018

文中写道

类的本质是结构体,在结构体中包含一些成员变量,例如method list 、ivar list 等,
这些都是结构体的一部分,method、protocol、property的实现这些都可以放到类中,
所有对象调用同一份即可...

1.文中说明的methodlist 和metod 有什么不同
2.文中说明的对象是类对象 or 实例对象
3.若是实例对象,那么实例对象的私有方法,对应的也就是实例对象的methodlist 是做如何处理的呢?

@Deeer
Copy link
Author

Deeer commented Jul 29, 2018

文中写道

调用super的方式时则调用objc_msgSendSuper()函数实现,调用时将实例变量的父类传进去
但是需要注意的是,调用objc_msgSendSuper函数是传入的对象,也是当实例变量

请问,你这是向表达什么?

@smallhorse87
Copy link

主要引出下面一道经典面试题:[self class] 和 [super class]打印内容是一样的吗?答案:一样的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants