Problem with scroll:removeSelf()

Hi.
I’m trying to remove a widget.newScrollView while it’s still scrolling down. When i call scroll:removeSelf() and insert a newTableView, it panics with the error

2012-12-13 14:04:34.725 Corona Simulator[1645:f03] Runtime error
?:0: attempt to perform arithmetic on a nil value
stack traceback:
[C]: ?
?: in function ‘?’
?: in function ‘update_scrollbar’
?: in function <?:860>
?: in function <?:229>
and it only stops when i reload the application.
If I remove the application after the moving of the scrollView , it works perfectly. Is there a solution to this error ? What can i do to solve this problem ?! [import]uid: 156274 topic_id: 33953 reply_id: 333953[/import]

Are you only removing the widget? Not the table of data it might be based on? [import]uid: 41884 topic_id: 33953 reply_id: 135023[/import]

You can’t insert something into a scrollView after you remove it. Also with the widgets as they are now, putting other widgets like scrollViews inside tableViews or tableViews inside scrollViews, there is too much competition for the touch events.

As for the other problem, you could use the event listener call back on the scroll view to set a flag that says when it’s scrolling and turn it off when it stops, or you could set a “remove when done scrolling” and in the event listener’s scrollEnded phase, look to see if it should remove itself and remove it after it stops.
[import]uid: 199310 topic_id: 33953 reply_id: 135059[/import]

Thanks a lot ,
That was a missing scroll:removeSelf() , instead I was using group:remove(1,scroll) ,
When i have 2 superposed lists it gets nuts … My solution was to move the bottom list. [import]uid: 156274 topic_id: 33953 reply_id: 135135[/import]

Are you only removing the widget? Not the table of data it might be based on? [import]uid: 41884 topic_id: 33953 reply_id: 135023[/import]

You can’t insert something into a scrollView after you remove it. Also with the widgets as they are now, putting other widgets like scrollViews inside tableViews or tableViews inside scrollViews, there is too much competition for the touch events.

As for the other problem, you could use the event listener call back on the scroll view to set a flag that says when it’s scrolling and turn it off when it stops, or you could set a “remove when done scrolling” and in the event listener’s scrollEnded phase, look to see if it should remove itself and remove it after it stops.
[import]uid: 199310 topic_id: 33953 reply_id: 135059[/import]

Thanks a lot ,
That was a missing scroll:removeSelf() , instead I was using group:remove(1,scroll) ,
When i have 2 superposed lists it gets nuts … My solution was to move the bottom list. [import]uid: 156274 topic_id: 33953 reply_id: 135135[/import]