Issues with display.newText()

Hi! I am currently on a Mac using Corona labs. I am really new at this and I am currently working on Chapter 2. I went to go and display the lives and score text and I keep coming up with an error message. I have tried several spacing issues and have checked over my lines multiple times and can’t seem to figure it out.  Any ideas what iI can do?

So the error says “Bad argument #1” and it got a nil, where a string was expected. Now the error is sort of misleading. The first argument can also be a display group or a table of parameters, but that’s not the important part here. A nil was passed into the first argument which is not allowed.  

Your first argument is uiGroup, so you need to figure out why uiGroup is nil.  There should be a line somewhere above it similar to:

local uiGroup = display.newGroup()

so we need to know why that’s failing.

Rob

So the error says “Bad argument #1” and it got a nil, where a string was expected. Now the error is sort of misleading. The first argument can also be a display group or a table of parameters, but that’s not the important part here. A nil was passed into the first argument which is not allowed.  

Your first argument is uiGroup, so you need to figure out why uiGroup is nil.  There should be a line somewhere above it similar to:

local uiGroup = display.newGroup()

so we need to know why that’s failing.

Rob