[string "app/views/MainScene.lua"]:161: attempt to index local 'HttpRequest' (a boolean value)的解决办法:

在调试cocos2d-x lua过程中遇到[string "app/views/MainScene.lua"]:161: attempt to index local 'HttpRequest' (a boolean value),解决方法为:

将HttpRequest.lua中的顶部的代码

local HttpRequest = class("HttpRequest")

改为

local HttpRequest = class("HttpRequest",cc.load("mvc").ViewBase)


或者在顶部的代码下面再增加一句代码:

local HttpRequest = class("HttpRequest")

改为:

local HttpRequest = class("HttpRequest")

HttpRequest.__index = HttpRequest

你可能感兴趣的:([string "app/views/MainScene.lua"]:161: attempt to index local 'HttpRequest' (a boolean value)的解决办法:)