JAListView
JAListView copied to clipboard
Orphaned list view items
my app has frequent listview reloads and I was getting ghost list view items that wouldn't go away no matter how many times I called [listView reloadData]
I ended up fixing this by removing the line [self.listView markViewBeingUsedForInertialScrolling:self];
from -(void)scrollWheel:
in JAListViewItem
. There doesn't seem to be any negative repercussions from doing this... at least nothing I've noticed yet.
If you want more details, let me know!
Otherwise it's a fantastic control, and I'm really digging it! I'll send you a promo code when my app ships. :)
Best, Cory
markViewBeingUsedForInertialScrolling
is used to ensure that we don't remove views that are being use for inertial scrolling. Presumably inertial scrolling will be broken on your list now?
Are you using JAListView
or some subclass? I've honestly never used JAListView
itself, I usually use JAObjectListView
, so it wouldn't be surprising if there were bugs.
Yeah, it breaks inertial scrolling, but it doesn't seem to break it in a destructive way... it just doesn't inertial scroll anymore. My list views have max 12 items in them, so inertial scrolling isn't really applicable anyway.
I'm using JAListView
directly. I based my implementation on the demo code, so I didn't even notice JAObjectListView
existed. I'll have a look at it, but right now I think just turning off inertial scrolling is going to work for me.
Ahh ok. Thanks for letting me know. If you feel adventurous, I'd be happy to accept a pull request that fixes it ;)
I've found a better solution.
Adding [self clearViewsBeingUsedForInertialScrolling];
right at the beginning of reloadAllViews
in JAListView
seems to fix the issue, without killing inertial scrolling. I don't feel confident that I know the code well enough to say if there are any other side effects of this, but when I've field tested it for a bit I'll submit a pull request.
Thanks again!
:+1:
Bump. @coryalder is this change production tested now?