1

I want to use a custom class that could handle querying easily. Are there more convenient ways in handling database in Objective C? Can you suggest open-source library or class that do this? Thank you for your answers in advance!

4 Answers 4

3

Not an inbuilt class but take a look at FMDB that makes it nice and simple!!

https://github.com/ccgus/fmdb

Sign up to request clarification or add additional context in comments.

6 Comments

I searched this but it I think it doesn't support ARC yet?
Correct but don't let this stop you, you can manually set files to non ARC. maniacdev.com/2012/01/…
How do you include FMDB to your project? Can I just drag the "fmdb.xcodeproj" to my project? or just the classes themselves and include the needed libraries? Any link for installation? Thank you!
You only need to drop in the .h and .m files that fmdb uses.
I always use Navicat myself. Works very well
|
1

FMDB is a nice library I have used a lot with success.

FMDB - Github

FMDB - article

4 Comments

I'm looking at it right now. Do they already support ARC? I'm using iOS 5.X .
No I'm afraid not. But you can always ignore ARC within those .m-files, or convert the project to ARC. Both ways should work fine.
How do you include FMDB to your project? Can I just drag the "fmdb.xcodeproj" to my project? or just the classes themselves and include the needed libraries? Any link for installation? Thank you!
Hi sorry for the delay. Ah you just can't drag it, but include the lib. Here's a guide icodeblog.com/2011/11/04/…
0

Have you had a look at Core Data? It can persist Obj-C objects to a SQLlite database.

Basically Core Data is an Obj-C <-> SQLite object mapper, which allows you to design your database schema in Xcode and work with the data as with normal Obj-C objects.

Xcode will provide you with visual database schema editing as well as code generation. This way you get typed classes for all tables in the database, which I find a great help (auto completion, compile-time checking, etc).

In addition to this, Core Data can take care of data migration for you. Say that in version 2.0 of your application, you want to store your data a little bit differently. You can then define a mapping between your own model and the new model, and the migration will take place as soon as your data context is loaded.

If you want to go the Core Data path or learn more about it, I recommend starting with a tutorial and checking out the sample code.

3 Comments

will you please tell me the whole picture of Core Data?
I cannot give you the whole picture, but I tried to summarize what I find good about it :) For the whole picture you have to go with the documentation..
Thank you. I just installed RestKit and they have awesome Object Mapping.
0

Easy to use object oriented sqlite wrapper that I created:

https://github.com/Nortey/TankDB

At the moment, its not meant for heavy duty queries or bulk updates. For that I would take everyone else's advice on FMDB. TankDB is more suited for beginners.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.