简体   繁体   中英

Best way to store game data on iPhone?

im creating a game that has multiple levels and the levels contain multiple textures and shapes.

What would be the best way to store this data on iphone/ipad?

I was thinking of using SQLite or coredata for storing it. But i also need to implement a function that will update the game data from a remote server (in game purchases). Is SQLite the best way to archive this? How would i then update the SQLite content when updating the content (download a .zip extract it and import into db/directory)? If anyone has any pointers i would really appreciate it!

The simplest way is to store them in a plist (which is an xml file). SQLite would require you to store it outside the app sandbox, in the documents directory (because including an sqlite inside the original app is read only).

Other than that, you can use coredata.

It's good to think about what SQLite and Core Data bring to the table. Both are very good for querying, but you will mostly only need to fetch objects for given ID? In that case you can also consider a simple file storage. We have used a plist index plus regular files to store some game data, it's a simple solution with low technical overhead.

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