I’ve gone through a few days of pain using RestKit to map some JSON. Being new to Core Data I made the assumption that once RestKit had mapped the data to my RestKit created DB, i.e.
objectManager.objectStore = [RKManagedObjectStore objectStoreWithStoreFilename:@"EFrontCD.sqlite"];
I could leave the RestKit world. I then attempted to load my data into a UITableViewController implementing the RKManagedObjectStore protocol and doing the usual stuff, but I get the error
UIManagedDocument can only read documents that are file packages
2 questions:
- Do I now have to do everything via RKManagedObjectStore?
- Can I get RestKit to use an existing Core Data package instead rather than creating a .sqlite file as above?
Thanks,
Ben
Answering the first part of my question, this is what I was looking for:
Once you have access to the MOC RestKit has created for you, then everything appears to be the same – I can do the usual Core Data stuff.
I’m still not clear about the second question, but would certainly like to know if this is possible.