The external framework that I use in my application determines theClasswhich internal structure is opaque.
Its instance variables are not intended for direct access.
@class TheClassPrivateVars;
@interface TheClass : NSObject
{
@private
TheClassPrivateVars *_theClassPriv;
}
@end
The open interface of the frame is not as complete as it should be, and (at my own risk) I want to read one of the private variables myClass.
Fortunately, the framework comes with full source code, so I have access to the definition TheClassPrivateVars:
@interface TheClassPrivateVars : NSObject
{
int thePrivateInstanceVar;
}
@end
I created a header file with the above code and included it only in the source file where "abusive access" should occur.
theValue = instanceOfTheClass->_theClassPriv->thePrivateInstanceVar;
Sorry _theClassPrivdeclared as @private.
?