I'm wondering how does a typical (or at least Apple's) implementation of the Objective C dynamic messaging system look. How are selectors handled at compile and run time, what does NSObject* really point at, how is the method implementation found in there.
In C++, we have virtual functions; how they are implemented is officially an implementation detail, but in reality a VF table pointer as a first data member is pretty much a given. I'm wondering if there's a similarly ubiquitous way of implementing ObjC's class system.
This can be quite lengthy. ughoavgfhw’s answer is a good start.
I’d recommend reading the following blog posts:
And if you’re not afraid of delving into source code, objc and clang are available at Apple’s Open Source Web site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With