UITableView Core Data reordering (next)
UITableView Core Data reordering
I'm having troubles with the solution above. If I do updates one by one (ie one move or one delete at a time) it works when back to noedit mode. But with more updates I get application crash. (I'm using a fetchcontroller开发者_如何学运维)
Could someone try this from a tableview not populated : - create 3 rows - hit edit mode and move 1st cell to 3rd position, still in edit mode delete the second cell. - back to noedit mode it crash for me
Besides this I'm trying to make it work in grouped style and with several sections, where you can move cells to any section. Is someone knows an application doing this correctly ?
Thank you
Well after days trying different solutions it seems I finally get what I wanted.
In addition to Ryan Ferretti solution I had to put a flag to bypass tableview updates when commiting moved modifications on CoreData, to get it work with nsfetchedresultcontroller delegate.
It is describe on Apple documentation, see User-Driven Updates : http://developer.apple.com/library/ios/#documentation/CoreData/Reference/NSFetchedResultsControllerDelegate_Protocol/Reference/Reference.html
I now get a tableview grouped style and can move rows from any section to another one, sorted like I want.
So don't forget this flag. :-)
精彩评论