简体   繁体   中英

iOS persistent store options

would like to ask for the community's suggestions. I need a persistent store in my iOS app. I have considered Core Data and SQLite and both are not ideal for the following reasons.

Core Data:

  • unable to model certain object relationships, such as Object A has a one-to-many relationship with NSString.

//Added:

  • unable to model a Dictionary(or map) as an attribute for a one-to-one relationship. ie Object A has a one-to-one relationship to Object B (and Object B behaves like a dictionary)

SQLite:

  • poor interface for schema management
  • no clean and elegant solution for data migration between schema versions

//Added:

  • unable to model a Dictionary(or map) as an attribute for a one-to-one relationship. ie Object A has a one-to-one relationship to Object B (and Object B behaves like a dictionary)

the persistent store has to be able to support search. If anyone can suggest ways to circumvent the problems, that would help too.

Based on your limited description, Core Data would work just fine. Core Data can easily do one to many relationships. No matter what technology that you use, you still need table to table (SQLite) or Object to Object (Core Data) relationships. Nothing is going to give you an Object to String relationship.

You can do Object A to Object B where Object B has only one property which happens to be a string.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM