Loading Pre-filled sqlite database into your app

Discussion in 'iOS Programming' started by AndyCodez, Nov 24, 2009.

  1. macrumors regular

    Joined:
    Aug 6, 2009
    #1
    I've been trying to get this going for a while. My main goal is to use a pre-filled database within my app instead of filling on first load. Due to that I'm loading 1600 rows from a csv file and it takes wayyy to long.

    I've tried a couple different methods while adding it to the resources in xcode. Is there something simple I am missing here? Doesn't work like images and sound apparently.

    Thanks for any help you offer ;)
     
  2. macrumors newbie

    tutukun

    Joined:
    Nov 19, 2009
    #2
    If you have someway to read sqlite file, i think you dont have to add it to the resource. just use direct path to open the file.
     
  3. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #3
    Add it to the Resources group, and make sure it is listed under the Copy Bundle Resources group under Target > [Your App]. Then you can use NSBundle to get the absolute path of the file.
     
  4. thread starter macrumors regular

    Joined:
    Aug 6, 2009
  5. thread starter macrumors regular

    Joined:
    Aug 6, 2009
    #5
    That worked great! Accept It seems the database is read only. I had a table that was used for score keeping and when the app tries to write to the database it isn't saving.

    Do you know of read-only issues with using these pre-filled databases?

    EDIT: Nevermind, found out resources group is read-only.
     

Share This Page