Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Realm + Listview with caching strategy issue ?

$
0
0

Hello everyone,

I recently encountered an issue with a simple xamarin.forms app (iOS only for now), using Realm as local database.

I created a page with a listview (with caching strategy to RecycleElement) displaying a list of RealmObject. Everything was fine until i put a delete context actions on the cell of my listview.

The problem was : When i deleted an item, then i added a new one:

  • The displayed informations in the cell was from the deleted item
  • I couldn't click on it and go to the detail page because of this error : "attempted to access detached row".

I struggled to find a solution, i even found a bugzilla from 2016 about it and heard they fixed it.

Then i tried to remove the caching strategy from the listview and come back to the default one (RetainElement). And the problem disappeared.

So i just wanted to share that for everyone who has or will struggle with this. And i've some questions:

  • Is this issue is not one and should error due to the Recycle Strategy ?
  • Is this a Realm or a Xamarin issue ?
  • Can this be avoid with another way ?

Thanks,

Best regards,

Armand


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>