I have some function module written in Objective-c, could i wrap the objective-C by C++, then integrate C/C++ code with Lua using toLua++, then using the lua code in Corona? Could i do that? It seems impossible...
Corona doesn't allow extending with native code (yet) It is in their roadmaps, and it is supposed to be implemented in coming months
you could make a shared library, then just require it into your code.
e.g. create mylibrary.so
then in lua
require("mylibrary")
lua will look for it in your LUA_PATH.
There are a few things I'm not sure of in corona - if it will load a shared library and you can use toLUa++. It will work fine in normal lua. You might have problems with bindings in the shared library to Cocoa - not sure, not something I've tried. I've built a .dll in windows and it worked fine - again not in corona.
Here's how to build a shared library
It seems like corona will do it - have a look here
this could be the stopper though - no shared libraries on iOS
hth
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With