when I populate the column data manually the pickerwheel displays fine. I have switched over to getting the data from sqlite and I get the following error.
Runtime error
?:0: attempt to index field ‘labels’ (a nil value)
stack traceback:
?: in function ‘?’
?: in function <?:389>
(tail call): ?
?: in function <?:122>
(tail call): ?
…pport/Outlaw/Sandbox/11/sblocationsobservatories.lua:132: in function <…pport/Outlaw/Sandbox/11/sblocationsobservatories.lua:57>
?: in function ‘dispatchEvent’
?: in function ‘gotoScene’
…brary/Application Support/Outlaw/Sandbox/11/main.lua:157: in function ‘showScreen’
…cation Support/Outlaw/Sandbox/11/sblocationsmenu.lua:43: in function ‘_onRelease’
?: in function ‘?’
?: in function <?:405>
?: in function <?:218>
the word ‘labels’ does not exist anywhere in my lua file.
My code looks like this.
local db = sqlite3.open( path )
columnData[1] = {}
local count = 0
local sql = “SELECT distinct obscntry FROM Observatories ORDER BY obscntry ASC”
for row in db:nrows(sql) do
count = count + 1
columnData[1][count] = row.obscntry
countryData[count] = row.obscntry
end
columnData[1].alignment = “left”
columnData[1].width = 296
columnData[1].startIndex = 1
columnData[1].fontsize = 12
– Create a new Picker Wheel
local pickerwheel1 = widget.newPickerWheel
{
top = gdata.screenTop + 222,
left = gdata.screenLeft + gdata.screenWidth/2 -150,
font = native.systemFontBold,
columns = columnData,
}
db:close()
group:insert(pickerwheel1)
I show 70 records before I try to display the picker wheel.
I am using
Copyright © 2009-2013 C o r o n a L a b s I n c .
Version: 3.0.0
Build: 2013.2091
any thoughts?