JSON to Persistent Data Store (CoreData, etc.)

前端 未结 2 1661
臣服心动
臣服心动 2021-01-30 05:48

All of the data on my application is pulled through an API via JSON. The nature of a good percentage of this data is that it doesn\'t change very often. So to go and make JSON r

2条回答
  •  囚心锁ツ
    2021-01-30 06:38

    • Accessors may be needed when there are to-many relations.
    • It is more efficient to use accessors than to use key-value. (Internally Core Data may use key-value anyway, so this point may not be true if that is the case.)
    • Using subclass and properties, the compiler can help you to detect problems, while using key-value, the problems will only show at runtime and harder to fix.

    Therefore, it is also good to subclass NSManagedObject and use generated properties and accessors.

提交回复
热议问题