Skip to content

Great ORM for the iPhone SDK

I’ve started to dwell into iPhone’s data persistence world, and I have to say it’s a very diverse one, for such a small-device platform. We developers have four basic approaches to save our application’s data (property lists, archiving/nscoding, core data and sqlite), not to mention that preferences get stored and saved outside our app, and that we also have the low level approach of reading and writing directly to files on disk (but who needs that?).

However, I am spoiled by my Ruby on Rails background, and I started to think about ORM and ActiveRecord in no time. It turns out that, as I expected, I found a few blog posts and projects out there for this. Nothing surprising, since I’m not the only one coming to the iPhone from Rails, and I have just recently started programming for this platform. Several people have been struggling with it for some time now.

One of the most promising and wonderful projects I found is called SQLite Persistent Objects. It’s like ActiveRecord for the iPhone written in Objective-C (of course), but even better in some respects. You don’t write you data schemas first, but your classes instead. It’s the objects the ones that create the database and tables in the background as needed. It even features dynamic search methods too!

If you’re programming for the iPhone, I really recommend it (although I haven’t tested it thoroughly yet). The article above gives a link to a download, but the project seems to be hosted on google code, so ti would be presumably better to download it from there.

Update (2009-10-23): Coincidentally today the author of SQLite Persistent Objects posted in his blog that after deciding to discontinue development, another developer took over, so the project (which I didn’t know was dying) is alive again! He also links to a great presentation that get you started very quickly.

Categories: Programming.

Tags: , , , , , ,

Comment Feed

One Response



Some HTML is OK

or, reply to this post via trackback.