Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wanting a simple overview on how to connect to a SQLite database in Cocoa/Objective-C

everyone. I've been experimenting with Cocoa and Objective-C programming on the Mac for a few months now, and I am wanting to start developing applications that manage large amounts of data. The trouble is, I'm not really sure where to start with databases.

I have a good background in Java programming with SQLite. I've read a bit about CoreData and I haven't been able to find any good resources for just manually connecting to the database. I'm looking for recommendations.

Should I try CoreData, and if so, can anyone recommend a good tutorial for someone new to the language? Or, should I try to manually connect and query an SQLite database somehow?

like image 272
Jesse Dunlap Avatar asked May 13 '10 23:05

Jesse Dunlap


1 Answers

Check out the supremely awesome FMDB. It's an Objective-C wrapper around the C SQLite API and makes it really really easy to deal with SQLite databases in Cocoa.

Oh, and it comes with some documentation and the sample code is pretty easy to understand and is decently commented. Chances are that 99% of anything you'd want to do with a SQLite database are demonstrated in the example.

In my opinion, if you use anything else to access a SQLite database (that's not a CoreData store), you're doing it wrong.

like image 91
Dave DeLong Avatar answered Sep 19 '22 02:09

Dave DeLong