Either
- compile as Objective-C++
- or declare it as
id
.
If you use id
, you should introduce the type in your definitions, e.g.:
// Foo.mm
Foo::~Foo() {
MyObjcClass * a = this->myObjcClass;
[a release];
}
In general, you should preserve the type (MyObjcClass
) and avoid using id
, but declaring the variable as id
is compatible with C and C++, so you can use id
to avoid compiling everything that includes Foo.hpp as ObjC++.