how to return C++ pointer in objective-C++
- by John Smith
I have the following objective-C++ header with the simple method to return this pointer.
@interface MyObj
{
MyCPPObj * cpp;
}
-(MyCPPObj *) getObj;
I have created the simple method
@implementation MyObj
-(MyCPPObj *) getObj
{
return cpp;
}
Everything seems to work until I actually try to use the object in another file
newObj =…