Ccui.listview 的格子点击的时候删掉这个list所在的层

我是这样做的 首先有一个 cc layer,有一个范围,如果点到范围之外就关闭这个层

然后 ccui.listview 加在这个cclayer上面,

listview.addEventListener(this.selectedItemEvent,this)

selectedItemEvent: function (sender,type){
if (type == ccui.ListView.ON_SELECTED_ITEM_END) {
var listViewEx = sender;
var curIndex = listViewEx.getCurSelectedIndex();
cc.log("select end child index = " + curIndex);

        this.removeFromParent(true);
    }

}
这段代码跑在网页端是没有问题的,但是跑在模拟器上就有问题了,
一到这里 this.removeFromParent(true); 必定崩溃,我试了好多种办法都不行 吐血了

我想实现的效果就是点击了listview里面的格子之后,删掉包含了listview的layer
求大神解答???

我吐血了一个临时解决办法

removemMyselfNextFrame:function(){
this.schedule(this.updateNextRemove);
},
updateNextRemove:function(){
this.unschedule(this.updateNextRemove);
this.removeFromParent(true);
},

这种肯定是有什么鬼事件没有传完,或者是自己触发的事件的那一帧不能删掉自己?
反正我迷糊了

上面的方法我试了下没问题orz,原理就是下一帧再删掉自己orz

顶顶,防沉