MySQL Objective C API?

Discussion in 'Mac Programming' started by gosselic, Oct 8, 2008.

  1. gosselic macrumors newbie

    Joined:
    Oct 8, 2008
    #1
    Hey folks,

    First time post - fairly simply question. I have been programming on OS/X for a little while now and ready to start coding my first major project. There is a known bug in the ODBC Administrator app and using the MySQL ODBC 5.1 or 3.51 driver and I've been searching around online for an API to use - rather than having to re-invent the wheel....

    I've found a few links about a MySQL Objective C API - however I haven't been able to get the examples to work so far...

    Question is... Anyone have any experience coding on XCode 3 and MySQL? Any thoughts/suggestions to make on where to get a little more clarification? I figured instead of spinning my wheels for 'x' more hours... I figured I would ask the collective brains of the Mac community :)

    Thanks ahead of time for any responses!
     
  2. gosselic thread starter macrumors newbie

    Joined:
    Oct 8, 2008
    #3
    So it does work then? I have tried a few times and keep running into issues. As long as someone got it to work on XCode 3.1, I'll keep fiddling away.
     
  3. garethlewis2 macrumors 6502

    Joined:
    Dec 6, 2006
    #4
    Just write your own, it's what I did.

    Yes it is tedious, but that OS project is ancient.

    Unless you need all the features of the MySQL C library, you just need to wrap 2-3 functions, and you can easily add the rest if you need them later. Believe me, it is only 2-3 functions. One to get a connection. One to perform a query. One to perform an update/delete/insert. You could even put the query and insert into one method.

    If you're looking for a particular example, this link contains a very quick program covering the C API for Sqlite3 using C++. You will find the MySQL one to be just as easy.

    http://freshmeat.net/articles/view/1428/

    I have to admit, I have written the Objective-C version of that C++ program, but it is a total waste of time as that is what Core-Data is for.
     
  4. gosselic thread starter macrumors newbie

    Joined:
    Oct 8, 2008
    #5
    Excellent - thank you very much for the info. Much appreciated!
     

Share This Page