[FIXED] How to write a SQLite3 Objective-C resultset wrapper

Issue

I am trying to write a SQLite resultset wrapper class for the iPhone, and I would like to be able to dynamically call sqlite3_column_int or sqlite3_column_text.

For example, in my fetchAll method, I would like to not know what exact data I'm returning, I just want to return it.

My goal is to have a class that doesn't care what data you have in the database, it gets you what you want, and it doesn't need to worry about the type of data.

I was thinking of using performSelector but I'm not sure how that would work.

How would I design such a class to make it easier for clients of the class to interact with sqlite?


Solution

You could take a look at how other wrappers do it. For example, here's the source of the resultset object from Flying Meat Database: http://code.google.com/p/flycode/source/browse/trunk/fmdb/src/FMResultSet.h http://code.google.com/p/flycode/source/browse/trunk/fmdb/src/FMResultSet.m



Answered By - Dave DeLong
Answer Checked By - Candace Johnson (sql.easybugfix Volunteer)

Related Posts

Post a Comment