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
    }
有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top