PDA

View Full Version : Most Efficient Way to Load Database Info?




Trickerie
Jul 6, 2010, 01:50 PM
Ok, so I'm wondering what the best/most efficient way is to load a database of info. For example, lets say I have a precompiled database of 100 movies. When the user touches the name of a movie, I want to load the information for it. Any advice for a newbie would be great :) Thanks!



themoonisdown09
Jul 6, 2010, 01:56 PM
If you're starting from scratch, Core Data (http://developer.apple.com/iphone/library/documentation/DataManagement/Conceptual/iPhoneCoreData01/Introduction/Introduction.html) is the way to go.

adrian.oconnor
Jul 6, 2010, 04:40 PM
I agree, CoreData is great and very easy, but I'd be tempted to go for the alternative: raw/pure sqlite. The advantage of sqlite is that it's a bit easier to create your pre-populated database and include it in your app as a resource. You can probably pre-populate a CoreData database too (it's also just sqlite, after all), but I haven't done it myself (whereas I have with pure sqlite).

There are also plenty of sqlite examples to get your on your way, but they're mostly old-school C (rather than Obj-C).

Trickerie
Jul 6, 2010, 06:57 PM
Im brand new to iPhone development, so I have no experience using coredata db's, any advice on a resource that could point me in the direction of building a db of the info I'll need to import?

Edit: I'm figuring I need around 100-150 max objects, each with attributes (name, date, etc). Is it possible to make a plist instead since thats relatively small? From what I'm reading, prefilling data into a program is a headache?