总是有各种各样的空值问题
if playerChips~=nil 这种空值判断根本不好用
像下面的代码,一般情况是OK的。 但是有极限情况 比如游戏从后台返回或者其他
就会导致 playerChips:runAction(cc.RemoveSelf:create()) 报错!
请问这里怎么处理?机制是什么?
local playerChips = createTableChips()
self:addChild(playerChips)
local function onEnd(icon, itype, chips)
if playerChips~=nil then
playerChips:runAction(cc.RemoveSelf:create())
end
end
poolChips:flyToOtherChips(playerChips , chipsToPlayerTime , readTime , onEnd)
```
