I am trying to figure out how to design a core-data setup.
I have one NSManagedObjectContext that runs in the main thread which is getting updated by another background thread(it has its own context) updating the main context by using the NSManagedObjectContextDidSaveNotification callback: This part of the system works fine.
My problem is when trying to save user data and how to send an immediately request to the web server for saving this data, while still adding it to the main context. The entity object is important because the request for saving the user data on the server is generated by looking at its attributes. And this entity object should be correctly updated if it has successfully updated the data on the web-server (from the background context to the main context).
So for example if i would create a new NSEntityDescription linked to the main context, do i listen to the NSManagedObjectContextDidSaveNotification and then create a background thread for which i would create a new context and send the entity object id. This would then update the main context and setting the object entity to sent?