This will explain it in detail: http://www.friday.com/bbum/2009/12/18/objc_msgsend-part-1-the-road-map/
In short, every Objective-C method is really a C function that has two mandatory arguments and then whatever arguments are passed to the method.
I.e. this:
- (void) foo:sender;
- (void) foo:(id)sender;
Is really this C function:
void foo(id self, SEL _cmd, id sender);
The pointer to the data refers to the self
parameter. Through that pointer to an object, the compiler generates all references to any instance variables of self
.