开发者

Store static Content on iPhone?

开发者 https://www.devze.com 2022-12-20 07:12 出处:网络
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).

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 tutoria开发者_运维技巧l?


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".


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号