[英]Pass c++ objects in Objective c wrapper
From what I understand you cannot pass c++ objects directly in objectiveC...I think. 据我了解,您不能直接在ObjectiveC中传递c ++对象。 Instead you have to pass a pointer.
相反,您必须传递一个指针。 Do you have to pass a void pointer and cast it?
您必须传递一个空指针并将其强制转换吗?
For example if I have two C++ objects b2World , and b2Body . 例如,如果我有两个C ++对象b2World和b2Body 。 If I then create two objective c wrappers World , Body do I then pass b2Body to World with a void pointer and cast it inside World ?
如果我再创建两个目标C包装世界 , 身体不要我再传给b2Body给世界一个空指针,并投它里面的世界 ?
I discovered that I was originally correct. 我发现我本来是对的。 You can pass c++ objects around through void pointers and then cast them.
您可以通过空指针传递c ++对象,然后进行强制转换。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.