FMDB or Core Data ?

Discussion in 'iOS Programming' started by whitedragon101, Feb 18, 2014.


Which implementation would you recommend I use?

Poll closed Mar 20, 2014.
  1. FMDB

    0 vote(s)
  2. Core Data

    4 vote(s)
  3. Raw mySQL_lite

    1 vote(s)
  1. whitedragon101 macrumors 65816

    Sep 11, 2008
    I am coding a questionnaire iphone app (maybe ipad eventually but not yet). People will go out into the field and ask questions. In SQL terms I picture the structure thusly :

    THIS_APP_DETAILS_TABLE (just one row of data to be stored)

    id_details_primaryKey | your_name | team_leader_name | team_leader_id | other_details....

    RECORD_OF_ANSWERS_TABLE (many rows of data to be stored)

    id_answers_primaryKey | name | answer_1 | answer_2| answer_3 | etc etc

    The app would store the answers to disk and also display them in a table and allow them to be edited.

    Would this be better implemented as core data or as fmdb?
    (which would mean I need to learn core data as I am from a SQL background and have never used core data).

    Do you agree that 99% of the time core data is the best way to code database driven apps rather than fmdb (or even raw mysql_lite) ?
    I ask that question as it does seem to be the prevailing answer when I googled it, but I want to be sure before learning an alien and proprietary data structure from scratch. Basically I don't want to discover I chose the wrong camp after I put all the work in.
  2. MrFusion macrumors 6502a

    Jun 8, 2005
    Definitely core data. It's ease to use and build right into UIKit. Start a new project and tick the core data option box. Everything is set up for you and you get iCloud included for free.
  3. moonman239 macrumors 68000

    Mar 27, 2009
    I use Core Data. It's easy to use and well-documented, and it allows you to use one of multiple database types, including SQLite.
  4. whitedragon101 thread starter macrumors 65816

    Sep 11, 2008
    I already have a project with a large story board and all the links (e.g classes, buttons, variables, modal navigation stuff) and code done. Can I still tick the box once the project has been created? Or can I transfer the story board and files to a new project (which I could create with the core data box ticked) and maintain the links?
  5. MrFusion macrumors 6502a

    Jun 8, 2005
    Do it the other way around. Create a new project with core data and copy the relevant code over to your existing project. Don't forget to add a core data model file.

    Perhaps just play around in a new project first to get the hang of it. The iOS master-detail template is a nice starting point.
  6. ChristianVirtual macrumors 601


    May 10, 2010
    After some initial misunderstanding on my side I now enjoy CoreData. Relative easy to use in single client mode; not yet tested with iCloud. I also tried FMDB before which worked also well but I still had to code the glue between data base and model in memory. Here CoreData wins.
    For highest performance I might would use hand coded SQLite but unlikely these days.

Share This Page