Ok so I'm using RestKit and I have it working pretty well when it comes to the JSON + Rest part of things but implementing Core Data has been quite hair-raising.
In essence, I have a DaoManager singleton that holds an RKObjectManager. From within my Singleton:
- I load some objects via RestKit into CoreData and getting back valid NSManaged Objects with a valid ManagedObjectContext (each one).
- I save these objects into an instance array and then call an NSOperation on some non-managed objects.
- The NSOperation calls a callback method on my Singleton on the main thread and I am able to see my NSManaged objects are still available but from within them, the ManagedObjectContext is now nil/null.
How this affects me is that the second I try to modify any of the properties on these objects, I get a CoreData Exception and I believe it's because the MOC is now nil.
Note: THe RKObjectManager and RKObjectstore are still valid throughout this whole process.
Has anyone else run into this? The thing about the MOC that RestKit sets up is that it's not really visible. It's supposed to handle everything itself in that way.
Any help appreciated. Thanks!