我需要幫助來解決問題。我真的不知道爲什麼會出現這個錯誤。 我使用此代碼爲我的最後一年項目開發旅遊應用程序。請幫我解決這個使用lua語言在corana中循環或以前的錯誤加載模塊
local accomodation = require("accomodation")
local function onComplete(event)
\t local action = event.action
\t if "clicked" == event.action then
\t \t if 2 == event.index then
\t \t \t -- Open url if "Learn More" was clicked by the user
\t \t \t system.openURL("http://www.trivago.com.my/?iPathId=74807&iGeoDistanceItem=0&aDateRange%5Barr%5D=2016-04-17&aDateRange%5Bdep%5D=2016-04-18&iRoomType=7&cpt=7480703&iViewType=0&bIsSeoPage=false&bIsSitemap=false&")
\t \t end
\t elseif "cancelled" == event.action then
\t \t -- our cancelAlert timer function dismissed the alert so do nothing
\t end
end
-- Show alert
local alert = native.showAlert("GoPenang", "You will be directed to trivago.com", { "Cancel", "Ok" }, onComplete)
-- Dismisses alert after 10 seconds
local function cancelAlert()
\t native.cancelAlert(alert)
end
function scene:createScene(event)
local group = self.view
end
function scene: enterScene(event)
local group = self.view
\t end
function scene:exitScene(event)
local group = self.view
end
function scene:destroyScene(event)
local group = self.view
end
timer.performWithDelay(10000, cancelAlert)
scene:addEventListener("createScene", scene)
scene:addEventListener("enterScene", scene)
scene:addEventListener("exitScene", scene)
scene:addEventListener("destroyScene",scene)
return scene
這是我住宿的代碼。錯誤將如下所示: enter image description here
你爲什麼在'accomodation.lua'裏面調用require(「accomodation」)?遞歸是一個強大的力量。明智地使用它。 –