我正在关注此URL,但我已经知道如何将我的目标c ++(。mm)实例传递给c ++类。 Calling Objective-C method from C++ method?
MyCPPClass.cpp
#include "MyCPPClass.h"
#include "MyObject-C-Interface.h"
int MyCPPClass::someMethod (void *objectiveCObject, void *aParameter)
{
// To invoke an Objective-C method from C++, use
// the C trampoline function
return MyObjectDoSomethingWith (objectiveCObject, aParameter);
}
如何从目标c ++(。mm)调用MyCPPClass::someMethod (void *objectiveCObject, void *aParameter)
我能从目标c ++(。mm)类传递void *objectiveCObject
的值。
答案 0 :(得分:0)
We can pass instance of objectiveC class to C++ -
someMethod ((void*)CFBridgingRetain(self),aParameter)