A similar question. Tell me what I’m doing wrong. In some function, in a loop (10x10 matrix creation), I create objects and hang listeners, I put the objects in a table:
for i = 1, 10 do
for j = 1, 10 do
playerCell: addEventListener (“tap”, placeSph)
playerTab [i] [j] = playerCell
end
end
In another function, I wanted to remove the listeners with this code:
for i = 1, #playerTab do
for j = 1, #playerTab [i] do
playerTab [i] [j]:removeEventListener (“tap”, placeSph)
end
end
Returns nil, does not remove the listener. Maybe I’m calling incorrectly via :