Build or Rosetta problem?

  
Hi

Just a warning: I’m the über newbie on Mac and development in Lua so there may be a fairly easy explantion for this.

I’m having some trouble with Corona and an app I’m developing. I got an error messeage when trying to build the app for iOS. The problem was something with a copypng in the iOS SDK. Google the problem and found a forum where they solved the problem by upgrading the iOS. I upgraded to version 4.63, that didn’t work for me. I then upgraded the newest version of Corona and that did the trick, but now it can’t “compile” ( I know this is not the term :slight_smile: ) the code. I then downgraded Corona to build 2012.971. The version where I did’nt have any problem was prior to that build.

The error is in a file that references a global variable where it state that it is nil. And as I wrote above, it didn’t fail before. The variable is a variable that holds the Rosetta object that is initialized in the main.lua. The Lua-file that files is in a subdirectory. The error message is: “attempt to index a nil value” The line where it fails is where I try to get an array of string from rosetta (I think that’s what is does?): “labels = rosetta:getString(“home”).buttons”

Is the problem the upgrade/downgrade or could it be code?
    
    
 

This line is your problem:

<lua>labels = rosetta:getString(“home”).buttons</lua>

Your retrieving a string from Rosetta as it’s intended for but then trying to access the “buttons” property as if it’s a table which won’t work. Would need to see the rest of your code to see what your intention was.

Also, I’m the creator of Rosetta so it’s cool to see it being used :slight_smile: You may be interested in my updated version called GGDictionary - http://github.com/GlitchGames/GGDictionary

Hi Jedi

Thanks for your answer. And thanks for the advice on GGDictionary. I will have a look at it :slight_smile:

Here is the code where it goes wrong. The strings in the buttons array is the text for som buttons in the app. The Rosetta is initialized in the main.lua file.

Home.lua file:

_labels = rosetta:getString(‘home’).buttons

– create the various page links
btn1 = createIconButton( ‘Dashboard’, 1, labels[1], 0, 270, ui )
btn2 = createIconButton( ‘Instructions’, 2, labels[2], 0, 270, ui )
btn3 = createIconButton( ‘Numbers’, 3, labels[3], 0, 270, ui )

btndealer = createDealerButton(‘Dealers’, labels[4], 0, 422, ui )
btndealer.x = cw / 2 - btndealer.width / 2_

 

Rosetta file:

“home”: {
    “buttons”: [
        “Instrumentpanel”,
        “How to”,
        “Contact”,
        “Find your servicepartner”
    ]
}

 

 
 

Rosetta and GGDictionary aren’t designed to store tables but rather just a list of plain strings so you would need to change your language files to match the format of the sample one.

This line is your problem:

<lua>labels = rosetta:getString(“home”).buttons</lua>

Your retrieving a string from Rosetta as it’s intended for but then trying to access the “buttons” property as if it’s a table which won’t work. Would need to see the rest of your code to see what your intention was.

Also, I’m the creator of Rosetta so it’s cool to see it being used :slight_smile: You may be interested in my updated version called GGDictionary - http://github.com/GlitchGames/GGDictionary

Hi Jedi

Thanks for your answer. And thanks for the advice on GGDictionary. I will have a look at it :slight_smile:

Here is the code where it goes wrong. The strings in the buttons array is the text for som buttons in the app. The Rosetta is initialized in the main.lua file.

Home.lua file:

_labels = rosetta:getString(‘home’).buttons

– create the various page links
btn1 = createIconButton( ‘Dashboard’, 1, labels[1], 0, 270, ui )
btn2 = createIconButton( ‘Instructions’, 2, labels[2], 0, 270, ui )
btn3 = createIconButton( ‘Numbers’, 3, labels[3], 0, 270, ui )

btndealer = createDealerButton(‘Dealers’, labels[4], 0, 422, ui )
btndealer.x = cw / 2 - btndealer.width / 2_

 

Rosetta file:

“home”: {
    “buttons”: [
        “Instrumentpanel”,
        “How to”,
        “Contact”,
        “Find your servicepartner”
    ]
}

 

 
 

Rosetta and GGDictionary aren’t designed to store tables but rather just a list of plain strings so you would need to change your language files to match the format of the sample one.