ERROR: bad argument #-2 to 'insert' (proxy expected got nil) ?

Hi @zemal,

Can you please post your most current code, containing the line which is giving you an error? I need to look at what you currently have.

Thanks,

Brent

I updated my initial post. I commented the line 122 as I sayd.

This is I currently have: the compiler still says that the error is on line 61 myList:insert and I don’t know why.

Hi @zemal,

This is the same syntax error as in the beginning. You are trying to insert a table into the tableView. You must insert display objects into specific tableView rows. Please study the documentation further to see how:

http://docs.coronalabs.com/api/library/widget/newTableView.html

Take care,

Brent

WOW! What a wonderful comment! You will be in all my app credits! I will look the documentation!!

 … but … I get the same error with this code:

local widget = require ("widget") local myList = widget.newTableView { } myList:insert{ }

… and so it is possible that the problem is could be another. I’m a newbie, not an idiot.

Hi @zemal,

It’s a common misunderstanding. You just need to obey the syntax for :insert:

http://docs.coronalabs.com/api/type/GroupObject/insert.html

For tableViews, each row is a display group, so you must insert display objects into a row. You can’t insert tables, and saying…

[lua]

myList:insert{}

[/lua]

…says that you’re trying to insert a table. This is not allowed.

Take care,

Brent