Changing scenes while a tableView is still scrolling?

I'm using tableView.lua to display a table and director.lua to manage scenes.

When I change scenes while a tableView is in motion, the terminal fills with multiple errors that look like this:

../tableView.lua:354: attempt to perform arithmetic on field 'y' (a nil value)

It looks like tableView.lua is attempting access a table that no longer exists after the scene change. I'd say that about 25% of the time the app will crash (usually it happens when I give my table a good spin just before changing scenes).

What is the best way to deal with this issue?

You will need to clean the tableView up, I'm going to assume that you are using Director so simply add a "clean" function like this to your screen:

1
2
3
4
        function clean()
                tableViewObject:cleanUp()
        end
        

I knew it had to be something simple like that. Thank you, now it works perfectly!

No worries, glad it got fixed!

views:1709 update:2011/10/2 9:44:12
corona forums © 2003-2011