In Objective-C, I'm curious how access controls for instance variables, like @private
,@protected
, etc. are implemented.
I had considered that separate structures were being generated in some way like this:
@interface Foo {
int bar;
@private
int baz;
@public
int qux;
}
=>
something along the lines of
struct Class_Foo_Protected {
int bar;
};
struct Class_Foo_Private {
int baz;
};
struct Class_Foo_Public {
int qux;
};
But I really have no idea. Anyone know how this was really done?