How to call lua functions from Obj-C?

Hi,

I am a iOS Developer, New to Corona. I have Corona Enterprise License and developing plugin for corona. I have two questions-

  1. How to set delegate in pluginLibrary.mm for any call backs from my objective-C Class/library?

  2. How to call a lua function from pluginLibrary.mm?

Hi Andy

In the project template folder of enterprise you will find a folder called App.

This is a very simple example showing how to do what you are asking for.

Hi ojnab,

Thanks for your answer.

 Now I am able to call lua function from my pluginLibrary.mm file but I have to call lua at run time and to call lua function i need lua_state object, how will i get lua_state object there?

But I didn’t find anything related to my first question-

  1. How to set delegate in pluginLibrary.mm for any call backs from my objective-C static library?

Hi Andy

In the project template folder of enterprise you will find a folder called App.

This is a very simple example showing how to do what you are asking for.

Hi ojnab,

Thanks for your answer.

 Now I am able to call lua function from my pluginLibrary.mm file but I have to call lua at run time and to call lua function i need lua_state object, how will i get lua_state object there?

But I didn’t find anything related to my first question-

  1. How to set delegate in pluginLibrary.mm for any call backs from my objective-C static library?