So I am implementing a feeds/timeline kind of app. Where basically when you open up the app initially it is going to memory and then use that data to return immediately, while in the background it is fetching the newer data from the server. The issue is that as of now I am storing the response to disk as raw JSON file. Now when I get back the new data from the server as JSON, basically I need to append/merge this JSON with the old one before saving it back to disk. This is quite a pain as I don't know how to merge the two JSON? Is it possible, if yes how?
The JSON format is as follows:
{
"data": {
"last_updated": 1342277036,
"stream": [
{
"action": {
}
},
"to": [
],
"from": [
],
"timestamp": 1342276421
},
{
"action": {
}
},
"to": [
],
"from": [
],
"timestamp": 1342276421
},
{
"action": {
}
},
"to": [
],
"from": [
],
"timestamp": 1342276421
},
If this is not a good way to do it. Then is is better to save the NSObject's to disk instead of the raw JSON file?