Hi, this is kind of a beginners question so please bear with me.
I've got a class that makes use of a third-party library (oniguruma, if that matters). I want library methods to be completely decorated by my own, so that I can switch the underlying implementation of my class anytime. Something like:
// MyClass.h
@interface MyClass : NSObject ...
- (int) doSomething;
// MyClass.m
#import "some_library.h"
@implementation MyClass
- (int) doSomething
{
//call library's specific stuff
}
So far, so good, but now I'm needing to use an instance variable in MyClass that has some library-defined type (a structure declared in "some_library.h"). Of course I can import the library right in the interface section:
//MyClass.h
#import "some_library.h"
@interface MyClass : NSObject {
some_library_t blah;
}
- (int) doSomething;
@end
but this is exactly what i'm trying to avoid - make users of MyClass aware of its implementation details.
Can I somehow "hide" library-specific types from my class' interface? What is the standard practice?