views:

60

answers:

3

Hi there, 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?

thanks.

+2  A: 

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

Mr.Gando
Thanks, let see if we can use this with three20
fabian
A: 

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.

Martin Cote
A: 

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

nevan
Core Data is not heavy at all and is a far superior option than using a plist.
Marcus S. Zarra
@Marcus S.Zarra I 100% agree, plist is often used to save application preferences or other kind of really small stuff. Of course you could use it to save a lot of stuff, but it wasn't really designed for that.
Mr.Gando
I'm not saying that a plist should be used to store a large amount of stuff, but if you have a list of 10 items with no need to change them, why not? It's ideal for a beginner (minimal setup and learning) and simple to change the values. I think that the OP has only been learning Cocoa for a couple of months and Core Data would be too complicated to tackle at this stage. (BTW, when I said "heavy duty", I meant that it's overkill, not that it would make the program run slower).
nevan