cocos2d-js icon indicating copy to clipboard operation
cocos2d-js copied to clipboard

在tableCellTouched中调用removefromparent导致apk崩溃

Open kawais opened this issue 10 years ago • 3 comments

在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(); } });

kawais avatar Jan 23 '15 10:01 kawais

经测试,this.removeFromParent();加入tests中,在手机上也会崩溃

kawais avatar Jan 23 '15 14:01 kawais

You need to delay the removeFromParent call for at least one frame, so that it can be properly removed in JSB

pandamicro avatar Jan 26 '15 07:01 pandamicro

在jsb中同时报错 一样的的

276361270 avatar Aug 15 '15 12:08 276361270