I’m using the tabbar viewcontroller from the community submitted code and its working well and I’m building an RSS reader app.
I have 4 screens, screen1.lua … screen4.lua.
Prior to today, I had the rss parsing code in each screen file. This is a lot of repeating myself and not very DRY, so I pulled the rss code out and made an rss.lua module (which I hope to contribute back to the whole)
Basically you call it as such:
local rss = require(rss)
then in the oncomplete callback from the network.download() api call, I do a:
stories = rss.feed(“index.rss”,system.TemporaryDirectory)
and in theory, stories holds the stories from the feed and I can take that information and load up a tableView with it.
This is all working … for screen1.lua. screen2, screen3 and screen4, contain the exact same code, but I get this error:
Runtime error
/Users/rmiracle/Lua/tACKY Project/tACKY/screen3.lua:68: attempt to call field ‘feed’ (a table value)
stack traceback:
[C]: in function ‘feed’
/Users/rmiracle/Lua/tACKY Project/tACKY/screen3.lua:68: in function
Its almost like I’m not allowed to require the same module in screen2-4 though I can in screen1.
Should I load it in main.lua and not make it local so its only loaded once?
[import]uid: 19626 topic_id: 13575 reply_id: 313575[/import]
