I’ve integrated a customized version of slideView in my application. My slideView.lua takes a table as a list of the images it should display when you call the new function. Without going into too much detail, my app scans the Documents Directory for images with certain names. It places these in a table, and then passes this to slideView.new() when I call it. I’ve printed the table, and all of the file locations are correct. Even the error shows the correct directory (several other errors follow, all due to this one). I have the directory scan print all the files and they’re listed as being right there. I’ve included the related code. Does anyone smarter than me know why this is happening? Thanks
---SET UP SLIDE VIEW------------ local slideView = require("slideView") local myImages = {} local lfs = require "lfs" local doc\_path = system.pathForFile( "", system.DocumentsDirectory ) for file in lfs.dir(doc\_path) do -- file is the current file or directory name print( "Found file: " .. file ) local temp\_s = tostring ( file ) local valid\_image = string.find( temp\_s, \_current\_category ) local file\_path = system.pathForFile( file, system.DocumentsDirectory ) if valid\_image ~= nil then table.insert ( myImages, file\_path ) end end --Set up image table \_slides = true slide\_view = slideView.new( myImages ) screenGroup:insert(slide\_view)
Here’s the error:
WARNING: Failed to find image(/Users/developer/Library/Application Support/Corona Simulator/13-9FE18D0245AD798036F6011A3800FA11/Documents/Test_1370130505.png)
Runtime error
…hx07fccr724h0000gp/T/TemporaryItems/13/slideView.lua:60: attempt to index local ‘p’ (a nil value)
stack traceback:
…hx07fccr724h0000gp/T/TemporaryItems/13/slideView.lua:60: in function ‘new’
…7fccr724h0000gp/T/TemporaryItems/13/image_viewer.lua:41: in function <…7fccr724h0000gp/T/TemporaryItems/13/image_viewer.lua:16>
?: in function ‘dispatchEvent’
?: in function ‘showOverlay’
…hx07fccr724h0000gp/T/TemporaryItems/13/view_bank.lua:90: in function ‘_onRowTouch’
?: in function ‘touch’
?: in function <?:773>
?: in function <?:218>