No, It is Immpossible.
The C ++ and Objective-C classes are implemented differently. C ++ uses vtable to search for a function and is static.
Objective-C, however, uses dynamic dictionary searches, and methods can be added at runtime.
However, you can use object composition to do what you want:
// MyCPPClass.cpp class MyCPPClass { int var; public: void doSomething(int arg) { var += arg; std::cout << "var is: " << var << std::endl; } }; // MyCPPWrapper.h
source share