Pre-populating app with data


SQL is pretty much out of scope for a book on iOS (or Mac) programming, since it’s a whole topic unto itself.

That said, the fundamentals of what you’re trying to accomplish should be totally doable.

Gus Mueller created an ObjC wrapper for SQLite several years ago, called FMDB (named after his company Flying Meat).

SQLite is quite popular, so there is a wealth of info about it, and many languages can talk to it. You could, for example, take a comma-delimited file and load it into SQLite using Perl or whatever your quick-and-dirty language of choice happens to be, then drop the resulting database into your iOS app for perusal.

One such tutorial on iOS+FMDB is here. The sample project – which appear to do everything you want, and more – is linked at the end of the article.

The advantage of using SQLite is that since it’s a database, queries can be quick. For that matter, you would’t need to copy the data over to Core Data. It’s hard to see the advantage of such a copy since the data is going to be static anyway.