Wednesday 18 September 2013

What is Objective-C's msgSendSuper behavior?

What is Objective-C's msgSendSuper behavior?

Checking the Apple's open source message dispatching code, I notice that
the call to super uses a struct holding the instance and a class it should
find the superclass method from.
Does this mean that the compiler must explicitly change messages to super
by adding the class it is called from?
And given some class tree where C extends B extends A, and all of them
implement a method m which calls [super m], and we create D extending A at
runtime, grabbing C's implementation of m to use as D's; will [d m] in
fact call all of D, B, and A's methods m instead of just D and A's?

No comments:

Post a Comment