I am removing/inserting item to listview in local function
But I get error message “LUA ERROR: ASSERT FAILED ON LUA EXECUTE: The object should not be nullptr”
this is my code
local state = true
local function pushItem()
state = not state
if state ~= true then
listview:insertCustomItem(subwidget, self:getIndex(widget) + 1)
else
listview:removeItem(self:getIndex(subwidget))
end
end
self:runAction(cc.Sequence:create(cc.DelayTime:create(1), cc.CallFunc:create(pushItem)))
So if you have many experiences, Please help me
Best Regards