cocos2d-js
cocos2d-js copied to clipboard
在tableCellTouched中调用removefromparent导致apk崩溃
在layer里面放置了一个tableview,希望点击某个cell时移除此layer,web上正常,但jsb之后在手机上点击后apk崩溃,在另一个平板上也是这样。代码如下 var ProfileListLayer = cc.Layer.extend({ ctor:function () { this._super(); this.init(); }, //其他代码基本照抄tests中的例子 tableCellTouched:function (table, cell) { cc.log("cell touched at index: " + cell.getIdx()); this.removeFromParent(); } });
经测试,this.removeFromParent();加入tests中,在手机上也会崩溃
You need to delay the removeFromParent
call for at least one frame, so that it can be properly removed in JSB
在jsb中同时报错 一样的的