Coming form Win8, I have been trying to replicate how I call any number of native functions from Lua. I have tried changing the name of the id from coronaView to coronaView2 and changing the message to the same on the Lua side but it doesn’t work. I have tried to grab the string and turn it to a sector but it looks like I can only send a method to an object, not just call one. For instance in Win8, I could do just use the message name and call that function and have as many as i want like this. I cant seem to find a way being a complete Xcode novice:
LUA:
function()Runtime:dispatchEvent({name=“nameOfFunctionToCallSentFromLuaAsString”});end,
//code which loads the chosen function
private void OnCoronaRuntimeLoaded(object sender, CoronaLabs.Corona.WinRT.CoronaRuntimeEventArgs e)
{
e.CoronaRuntimeEnvironment.AddEventListener(“nameOfFunctionToCallSentFromLuaAsString”, doFunctionInNative);
}
//chosen function
private CoronaLabs.Corona.WinRT.ICoronaBoxedData doFunction(
CoronaLabs.Corona.WinRT.CoronaRuntimeEnvironment sender, CoronaLabs.Corona.WinRT.CoronaLuaEventArgs e)
{
return null;
}