Most efficient/recommended way to access a catalog?
I want to create an iPad application that is pretty much just a catalog of products(say for example, cars) I will have around 500 products total, and each product is pretty much an image that will load up when the user requests it.
example: Product_ID: 124 Name: 'myImage.png'
User types a product id, the image will show up on a UIImage.
I was wondering what would be the smartest approach to this problem? I was thinking about SQLite or NSArray. Where the id would be the product id, and the value would just be the l开发者_开发知识库ocation or name of the image to load. Creating a cache document folder? Any suggestions from people that have already experimented and created similar apps?
I'd add the meta information like ID and the name of the image to a sqlite DB and manage it via CoreData, which has some very powerful ways to access the information.
The images themselves should be stored outside the database as I assume that they are not just thumbnails.
Best way would probably be Core Data. It has built in caching, so you won't have to worry about that. Here's a get started documentation: Introduction to Core Data Programming Guide. There are also a lot of tutorials online, but Apple has really good start up samples.
精彩评论