Prefilling Core Data

Discussion in 'iOS Programming' started by aleclerc, Oct 27, 2009.

  1. macrumors newbie

    May 15, 2009
    I've been following Core Data, Part 5: Prefilling Data but I feel like there's something missing.

    If you're not familiar, it's basically telling me to create another program that's a db filler with the same xcdatamodel, and use a csv file to fill it up. Then I'm supposed to copy the .sqllite file I created to my original project.

    It suggests changing the
    NSURL *storeUrl = [NSURL fileURLWithPath:
        [[self applicationDocumentsDirectory]
            stringByAppendingPathComponent: @"Money.sqlite"]]; 
    in the prefilling program to match the sqlite file that my 'real' product should have.

    So I let it run in simulator and get a .sqlite file in the ~/Library/Application Support/iPhone Simulator/User/Applications/{appid}/Library

    and put it in my "real" project bundle, but it's not reading the file from the bundle. I have a feeling I'm missing something here, like having to copy over that .sqlite file to my new application directory by code or something. Does anyone have any suggestions?

Share This Page