For a simple note application, there is a table view controller with a fetchedResultsController that has a list of saved notes in core data. The user can either click the + button to add a new note or click on one of the records in the table view to edit an existing note. In either case, a modal view controller with a text view shows up.
I want to save as the user types each letter, so in textViewDidChange I am updating Core Data. If the user types too fast, the core data saves hang. I recently added code to add the updates to NSOperationQueue which was an idea taken from here:
How to implement work queue in iOS where only newest request is handled? and that has helped somewhat.
Here's the problem I need help with. Let's say the user types an update in the textView, then pushed Done to return to the table view controller, and then clicks on the same note to edit the note again before the original update was refreshed in the table view. The user is presented with a textView that has the old data. The update is not there. If the user goes back to the table view and edits the note again, the latest updates show.
What are some approaches to consider, or how could I attempt to fix this issue? I want the textView to always show the latest updates even if user is switching back and forth from the textView and tableViewController faster than a user should ;)