Hello!
I need to fetch from server array of objects without unique identifiers. My API is:
GET /measurements
[{"bpm": 76,"timestamp" : "2014-01-02T19:20:30+01:00"}, {"bpm": 76,"timestamp" : "2014-01-02T19:20:35+02:00"}, ...]
I don't need to persist that data so I use temporary context (as you suggested in one of your previous answers). When server returns 1-5 objects - it works perfectly, but when response contain more then 5 records I get error:
Error Domain=com.mutualmobile.mmrecord Code=5 "Unknown Error Unable to save background context. Import operation unsuccessful." UserInfo=0x10d14d030 {NSLocalizedDescription=Unknown Error Unable to save background context. Import operation unsuccessful.}
I made few experiments:
-
I tried to add primary key to may data model and inject it with entityPrimaryKeyInjectionBlock. Key injection works, but the same error when more then 5 entries.
-
I took model scheme from 1), but instead of injecting keys I modified server to return id-s in response - everything works fine.
-
I thought it's something wrong with the rest of my app so I created very simple test project based on MMRecordFoursquare: AFNetworking 2.0, MMDataManager copied from example, one entity in data Model. The same experience.
Looks like I'm missing something very obvious here...