Loading files from the simulator.

Discussion in 'iOS Programming' started by detz, Aug 8, 2008.

  1. detz macrumors 65816

    Joined:
    Jun 29, 2007
    #1
    So I have txt files that are saved on the filesystem and I'm able to read/write these fine but the problem is the simulator changes paths every time it's run. Is there a way to force it to use the same path so I don't have to copy these files to the new location every time?
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Drag the files into the Resources group in your Xcode project. Then you can access them via [[NSBundle mainBundle] pathForResource:mad:"somefile" ofType:mad:"txt"]
     

Share This Page