Display Objects Showing On Wrong Screen

I am wondering if anyone is having the same issues.

 

My app has the following scenes:

 

sceneA -> sceneB -> sceneC

 

I have a TableView in sceneB where each row contains an image from display.loadRemoteImage. The tableview renders fine but as I scroll up and down quickly, row images suddenly appear at 0,0 as well as in their row. When this happens, the image persists across my other scenes even though I am doing a deleteAllRows on the tableview. I have also tried doing a storyboard:purgeAll() on all scenes.

 

SceneC that has an image from display.loadRemoteImage. When I go back to sceneB, the image from sceneC is displayed. The image also persists across scene changes.

 

I’m sure it could be my code, but was wondering if anyone else has experienced this.

 

Thanks!

 

David

What version of Corona are you using?  If it’s before 1034, then you are likely using Widgets 1.0.  We just released Widgets 2.0 in daily build 1034.  If you are using the last public build, it’s 1.0.

 

That version of the tableView removes rows that scroll off the screen to save memory.  Those rows, when scrolled too quickly can still be in the process of being updated while being removed.  This really becomes a problem if you’re using network.download() to download photos from the internet like avatars or photos from Flickr that are being loaded asynchronously, those call backs can fire after the row is destroyed.

 

You basically have to check to make sure the row group exists before you put anything into it.   Widgets 2.0 (which you have to be a paid subscriber to get)  is supposed to be better at this but you should still program to protect against async events happening to things that are no longer around.

Thanks Rob. That makes sense about the rows being removed while scrolling off the screen. It seems to happen only when I scroll very fast. I am a subscriber but am hesitant to use Widgets 2.0 until it appears in a stable release. I will add some code to check if the row is still on the screen, if not ignore downloading the image.

 

Thanks,

 

David

What version of Corona are you using?  If it’s before 1034, then you are likely using Widgets 1.0.  We just released Widgets 2.0 in daily build 1034.  If you are using the last public build, it’s 1.0.

 

That version of the tableView removes rows that scroll off the screen to save memory.  Those rows, when scrolled too quickly can still be in the process of being updated while being removed.  This really becomes a problem if you’re using network.download() to download photos from the internet like avatars or photos from Flickr that are being loaded asynchronously, those call backs can fire after the row is destroyed.

 

You basically have to check to make sure the row group exists before you put anything into it.   Widgets 2.0 (which you have to be a paid subscriber to get)  is supposed to be better at this but you should still program to protect against async events happening to things that are no longer around.

Thanks Rob. That makes sense about the rows being removed while scrolling off the screen. It seems to happen only when I scroll very fast. I am a subscriber but am hesitant to use Widgets 2.0 until it appears in a stable release. I will add some code to check if the row is still on the screen, if not ignore downloading the image.

 

Thanks,

 

David