Core data property not updating
If anyone has any thoughts on this, I'd appreciate it! I am currently working on a client app that 100% does this, for the most efficient result, we used a 'manifest' core data object which then has relationships and stuff, which gets deleted when there is an update, then on parsing the manifest, you create only.
The deleting would purge all data Are you worried about resource usage, about there being a gap with no data available, or are you worried about the time between requesting data and new data appearing? I worked on a project that ingested 2MB of JSON and saved it to the CD database in like 20 seconds on an i Pad 1.
Once the app matures we expect there to be many thousands of records in the manifest.
The simplest implementation would be to just purge every Core Data record and re-write it all with the fetched manifest.
But if you do know the modified dates, it's perhaps easier to have the server generate a static JSON covering all of the changes between version 11 and 12 so you don't need to do that work on every client.
First of all, I couldn't really understand what exactly you're updating - are you updating the schema of the entities such as the attributes and how they're defined?
You'd have to test it, but that's a whole lot of work for "maybe faster."Just be aware that you're going to need to pass deleted objects down with a deleted status if you're updating your manifest.
How many changes do you expect and how do you track changes?
The latest version of the manifest, which is just a JSON document on our server, gets pulled and parsed by the client at the beginning of a new session.
Or are you not updating entities, but updating the records created?
If the former, then have you heard of Core Data Migration?
Saving data in the disconnected scenario is a little bit different than in the connected scenario. Here, if the key property value is zero then we will consider it a new entity and so we will set the Added state.
If the key property value is greater than zero, then it means it is an existing entity and so we will set the Modified state.