Requires a simple overview of how to connect to a SQLite database in Cocoa / Objective-C

everything. I have been experimenting with programming Cocoa and Objective-C on Mac for several months, and I want to start developing applications that manage large amounts of data. The problem is that I'm not quite sure where to start with databases.

I have good Java programming experience with SQLite. I read a little about CoreData, and I could not find good resources to easily connect to the database manually. I am looking for recommendations.

Should I try CoreData, and if so, can someone recommend a good tutorial for someone new in this language? Or should I try to manually connect and query the SQLite database in some way, and if so, any tutorials? Any help would be greatly appreciated!

Thanks!

+6
database sqlite objective-c cocoa macos
source share
3 answers

See the supremely awesome FMDB . This is an Objective-C wrapper around the C SQLite API and makes Cocoa SQLite databases really easy to work with.

Oh, and it comes with some documentation and sample code is pretty easy to understand and decently commented on. Most likely, 99% of everything you would like to do with the SQLite database is demonstrated in this example.

In my opinion, if you use anything else to access the SQLite database (this is not a CoreData repository), you are doing it wrong.

+7
source share

Apple has several Core Data tutorials, such as: http://developer.apple.com/cocoa/coredatatutorial/index.html

If you want to use sqlite just use the sqlite C API: http://www2.sqlite.org/cintro.html

+3
source share

For easy connection to sqlite you should use the following guide! Small class for connecting and consulting BD Sqlite

I am making a few changes to add NSNull if the select no elements are given and the error is corrected: enter a link description here with 4 lines, and this class in lens c you can easily handle.

0
source share

All Articles