Hello everyone,
I want to use some classes for my addon, but I have a problem with pairs() in methods. A exemple :
Code:
ClassTest = {}
ClassTest.__index = ClassTest
function ClassTest:New()
local self = {}
setmetatable(self, ClassTest)
self.tab = {}
return self
end
function ClassTest:CheckTab()
for i=1, stat in pairs(self.tab) do
-- Do something
end
end
There is a error on pairs() function. I find
this topic that seem a similar problem, but metatables are new for me and I don't understand the (potential) solution.