Home Tutorials Download Beta Store Forum Documentation KnowledgeBase Wiki Blog

ShiVa3D

Return to Plugins

iOS Plugin  

ShiVa Plugin Development

iOS Plugin

Postby eragon » 04 Nov 2011, 10:46

Hi all,

How to include an objective c header into shiva plugin xcode project?
I have created a method in objective C, and would like to call it inside my
C++ file. I've change the C++ file to .mm file, change the objc compiler into
cpp.objcpp, but then when I try to build it, it give me the following error,
"Statement-expressions are allowed only inside functions".

Does it mean that, this is not possible?

Thanks in advance.
eragon
Fresh Boarder
Fresh Boarder
 
Posts: 9

Re: iOS Plugin

Postby NiCoX » 04 Nov 2011, 11:22

Hi,

You need to create a "proxy" between C++ and ObjC. Here is a sample:

Code: Select all
http://developer.stonetrip.com/Download/Misc/com.stonetrip.nativemessagebox.7z
User avatar
NiCoX
Platinum Boarder
Platinum Boarder
 
Posts: 5652
Location: France

Re: iOS Plugin  

Postby eragon » 04 Nov 2011, 11:47

Thanks for the reference :) Helps a lot, I see how
you link them together.

But, just to make sure, we no need to include "NativeFunctions_iOS.mm" into
our plugin project right ?

Thanks in advance.

Edit: It seem like I fixed the issues :) Thanks for reply
eragon
Fresh Boarder
Fresh Boarder
 
Posts: 9


Return to Plugins