AsyncDisplayKit icon indicating copy to clipboard operation
AsyncDisplayKit copied to clipboard

ASTableView with NSFetchedResultsController

Open 1nput0utput opened this issue 11 years ago • 6 comments

I am facing an issue when I use ASTableView with NSFetchedResultsController, I am unable to perform any update to the tableView inside NSFetchedResultController delegate -didChangeObject, I get this: Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray insertObjects:atIndexes:]: index 17 in index set beyond bounds [0 .. 0]'

Shouldn't calling -endUpdates() do all the inserts and updates???

If I run the same operation on the table -- I save the indices require insert or update in an array -- inside -controllerDidChangeContent before calling -endUpdates() I have no crash. I don't see how this is any different compare to controllerDidChangeContent.

Anyone have an idea why this is happening?

1nput0utput avatar Oct 01 '15 20:10 1nput0utput

@1nput0utput yes, this issue is fixed in master. Please try pointing your project to master (or a specific commit) and confirm this is the case for your app! Check out some of the recent Issues & merged PR discussions for details.

appleguy avatar Oct 02 '15 00:10 appleguy

@appleguy the master branch didn't work out for me, though the PR on #693 which is not merged yet has the fix and works for me.

1nput0utput avatar Oct 02 '15 03:10 1nput0utput

@1nput0utput aha, of course, in my haste to reply during a meeting I didn't realize that of course NSFetchedResultsController would require the fix for the edit ordering in addition to the delegate call timing fix that was landed to master earlier (and addressed issues for the majority of use cases that were encountering problems).

Feel free to weigh in on the discussion there. As you can see, it is arguably the highest priority change for the community right now, and we're actively trying to figure out the right approach. This weekend's ASDK list for me is very long, but a deeper review / set of recommendations around that diff is definitely going to happen.

appleguy avatar Oct 02 '15 04:10 appleguy

@1nput0utput Can you check if master resolves this, now that #753 is merged?

Adlai-Holler avatar Oct 28 '15 02:10 Adlai-Holler

@Adlai-Holler I am currently testing the master branch. I have not come across any issues regarding indices order with NSFetchedResultController. Looks all good!

1nput0utput avatar Oct 28 '15 02:10 1nput0utput

I have not found any obvious issues after #753 merge. I am closing this issue.

1nput0utput avatar Oct 30 '15 00:10 1nput0utput