Scrollview crash

UI.ScrollView = cc.ScrollView.extend({
ctor:function(){
cc.associateWithNative(this, cc.ScrollView );
},
setCellWidth:function(cellWidth){
this.*cellWidth = cellWidth;
return true;
},
moveForward:function{
this.setContentOffset.x-110,this.*container.getPosition().y),2);
},
onTouchEnded:function(touch,event){
this.*super;
if {
this.*delegate.onTouchEndDid();
}
this.setContentOffset(cc.p(this.*cellWidth*Math.round.x/this.*cellWidth),this._container.getPosition().y));
},
registerWithTouchDispatcher:function () {
cc.Director.getInstance().getTouchDispatcher().addTargetedDelegate(this, –256, false);
}
});

I have some code like this up, but when the app is launch and crash soon, Is something I wrong! Need help!


A77CB104-4C53-48B8-90FA-4F2EC2364521.png (34.8 KB)

Justin Zhang wrote:

UI.ScrollView = cc.ScrollView.extend({
ctor:function(){
cc.associateWithNative(this, cc.ScrollView );
},
setCellWidth:function(cellWidth){
this.*cellWidth = cellWidth;
return true;
},
moveForward:function{
this.setContentOffset.x-110,this.*container.getPosition().y),2);
},
onTouchEnded:function(touch,event){
this.*super;
if {
this.*delegate.onTouchEndDid();
}
this.setContentOffset(cc.p(this.*cellWidth*Math.round.x/this.*cellWidth),this._container.getPosition().y));
},
registerWithTouchDispatcher:function () {
cc.Director.getInstance().getTouchDispatcher().addTargetedDelegate(this, ~~256, false);
}
});
>
I have some code like this up, but when the app is launch and crash soon, Is something I wrong! Need help!

I modify the file: CCScrollView.cpp, change m_pTouches~~>release(); to CC_SAFE_RELEASE(m_pTouches); and now not crash. This is a bug or something?

cc.Director.getInstance.getTouchDispatcher.addTargetedDelegate has not been bound to JS in 2.1.2. We’ll add this feature at next release v2.1.3 (May 1).