One or two managedObjectContext
I am currently developing an application which makes HTTP request (via AsiHTTPRequest) then parse a JSON stream. Basically there is a tableView/NSFetchedResultsController, which print objects fetched from coreData, and the refresh is hand-done via a UIButton. I want my page to see the changes (so I implemented the NSFetchedResultsController).
But if the user refresh in the underg开发者_C百科round for instance, then the parsing will be differed, waiting for the answer of the request. Meanwhile the user can navigate and click on a Core Data object, which ca be deleted while he's reading it.
What would happen ? Also, what is the best moment to save the context ? Or is it better to use 2 context and then synchronise them ?
Thanks in advance for your opinions.
Niels
With a good use of the NSFetchedResultsControllerDelegate, only one NSFetchedResultsControllerDelegate is sufficient.
Hope it helps, Niels
精彩评论