Comments on: Populating UITableViewCells Asynchronously to Fix UITableView Lag https://ushipblogsubd.wpengine.com/shipping-code/populating-uitableviewcells-asynchronously-to-fix-uitableview-lag/ Fri, 10 Aug 2018 18:50:08 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: César Palma https://ushipblogsubd.wpengine.com/shipping-code/populating-uitableviewcells-asynchronously-to-fix-uitableview-lag/#comment-520 Sun, 19 Nov 2017 04:21:00 +0000 https://ushipblogsubd.wpengine.com/?p=4259#comment-520 In reply to Charles Lambert.

Hi Charles, I’m reading your comment and that’s exactly what I’m trying to figure it out. Did you find any solution to manage the problem?

]]>
By: Jeremy https://ushipblogsubd.wpengine.com/shipping-code/populating-uitableviewcells-asynchronously-to-fix-uitableview-lag/#comment-510 Fri, 17 Feb 2017 02:29:00 +0000 https://ushipblogsubd.wpengine.com/?p=4259#comment-510 Really great solution, how would you apply this to a self sizing cell? One of my table views has an automatic layout but this seems to mess that up for me.

]]>
By: Charles Lambert https://ushipblogsubd.wpengine.com/shipping-code/populating-uitableviewcells-asynchronously-to-fix-uitableview-lag/#comment-490 Fri, 23 Sep 2016 20:47:00 +0000 https://ushipblogsubd.wpengine.com/?p=4259#comment-490 Hey! Thanks for this great article. It is super helpful 🙂

I have implemented the same solution for one of my UITableView which queries a lot of data through Core Data for every UITableViewCell. There’s one missing piece to my solution though. I was wondering if you had an idea how to solve this.

So like I said, I implemented the same approach as you did but the difference is that, for example, when I call a function like self.model.textForIndexPath(indexPath), my model asks its NSFetchedResultController for the objectAtIndexPath and the returns me the text. The thing is that the NSFetchResultsController was initialized with a NSManagedObjectContext that was itself initialized with a private queue (NSPrivateQueueConcurrencyType).

This means that the NSOperationQueue we created for every UITableViewCells are trying to access objects in a NSManagedObjectContext that was not initialized on the same thread. This throws an exception as NSManagedObjectContext and NSManagedObject are not thread same and they shouldn’t be initialized in one thread and accessed from a different thread. Do you have any idea for a solution?

Thanks

]]>