Frage

It would be better to ask here, since I could't see a light on my google search results.

Finally, my iOS app and web app can smoothly sync data. On iOS side, core data is used for playing with offline data. On web app, user is able to add custom fields to any database table.So, newly added field exists in newer request results. How should I manage my app, so that it continue to work with offline data containing newly added fields.

What is the best pattern to solve this issue? Are there any framework related?

EDIT: Old REST get Result

{
  "status":"SUCCESS",
  "data":{
    "id":1,
    "createdDateTime":"2012-05-07 08:18:11",
    "modifiedDateTime":"2012-05-07 08:18:11",
    "createdByUser":{
      "id":1,
      "username":"super"
    },
    "modifiedByUser":{
      "id":1,
      "username":"super"
    },
    "owner":{
      "id":1,
      "username":"super"
    },
    "department":null,
    "firstName":"First",

  },
  "message":null,
  "errors":null
}

After Custom field addition, new REST result:

 {
      "status":"SUCCESS",
      "data":{
        "id":1,
        "createdDateTime":"2012-05-07 08:18:11",
        "modifiedDateTime":"2012-05-07 08:18:11",
        "createdByUser":{
          "id":1,
          "username":"super"
        },
        "modifiedByUser":{
          "id":1,
          "username":"super"
        },
        "owner":{
          "id":1,
          "username":"super"
        },
        "department":null,
        "firstName":"First",
        "customField":"hello",
      },
      "message":null,
      "errors":null
    }
War es hilfreich?

Lösung

There is a detailed discussion on dynamically adding Core Data attributes here.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top