i am getting the attempt to call method ‘removeSelf’ (a nil value) error
my code is below
thanks in advice.
[lua]
local response
local o
local item ={}
json = require(“json”)
–response="{“data”:{“data”:[{ “item”:1,“amount”:5,“totalamount”:10,}, { “item”:2,“amount”:15,“totalamount”:110,},]}}"
local t = [[{ “one”:1 , “two”:2, “primes”:[2,3,5,7] } ]]
o = json.decode(t)
item[1]={}
item[1].one = o.one
item[2]={}
item[2].two = o.one
if( o ~= nil ) then
o:removeSelf()
o=nil
end[/lua]