Store static Content on iPhone?

不羁岁月 提交于 2019-12-12 01:29:59

问题


I was wondering what is the best way to store static content for my app. E.g. a list of products (name, photos, price, url).

Maybe s.o. can direct to a good tutorial?


回答1:


I think Core Data is the best way , and you should use that.

Here's a link to Apple's Docs ( tutorial )

Also theres a good discussion in Jeff Lamarche's blog in this post

A good thing to check for, would be Jeff's book "More iPhone 3 Development".




回答2:


You can store everything in a SQLite database file which would be provided as a resource in your app. But it is of course better to let Core Data read that file for you.




回答3:


I think both Core Data and SQLite are too heavy duty for what you want. Unless you have a large list of products, you should store them in a plist. The setup is minimal and accessing it is far easier than any of the other solutions. It's ideal for a small amount of static information and very easy to edit later.

Here's a tutorial on using plists:

http://humblecoder.blogspot.com/2009/05/iphone-tutorial-storing-and-retrieving.html



来源:https://stackoverflow.com/questions/2260982/store-static-content-on-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!