I have a Core Data Entity that receives periodic updates from a web service. When this Core Data Entity changes it’s content, I would like a delegate method to be called on one of my View Controller Classes. This is so I am able to update the appropriate data on that view controller. How would I go about doing this.
This is similar to the NSFetchedResultsController that sends a delegate message to the Table View when the Core Data contents are changed but I do not wish to use the NSFetchedResults Controller in this case.
Thanks
If I were you, I would actually do something other than delegation: I would use notifications.
You can observe the “NSManagedObjectContextDidSaveNotification”, and when it saves the changes from your web service, you can queue activity in your view controller.
So, say you wanted to start this observance when the view controller was created, and finish when the view controller finishes:
And then all you need to do is observe the change: