Rethinking Edits
When working with Core Data–powered tables, Recipe 12-3 doesn’t let users reorder rows. That’s because its fetch requests sort the data, not users. Recipe 12-3’s tableView:canMoveRowAtIndexPath: method hard-codes its result to NO. Yes, you can work around this by introducing a custom row position attribute. Much of the time you won’t want to. Recipe 12-3 shows a common use case.
In a similar vein, make sure you coordinate any database edits to your data sources. With Core Data–driven tables, these changes may come from user requests (swiping, pressing +, and so forth) and also from the undo manager. By subscribing to the fetched results controller as its delegate, you’ll know whenever data has updated from undo actions. Use the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access