This sounds like a classic use for the / @ protocol interface. Define the objective-c protocol for the API, and then provide an implementation of this protocol using the Objective-C ++ class. Therefore, customers only need to know the protocol, not the implementation header. Therefore, given the initial implementation
@interface Foo : NSObject
{
id regularObjectiveCProperty;
CPPClass cppStuff;
}
@end
I would define a protocol
@protocol IFoo <NSObject>
@end
Foo
@interface Foo : NSObject <IFoo>
{
id regularObjectiveCProperty;
CPPClass cppStuff;
}
@end
id<IFoo> Objective-C ++. , Foo .