If you do not have a resource directory in your project, select your project:
Then, on the File menu, select Add Files:
In the window that opens, click the "New Folder" button in the lower left corner of the window.
A small popup window will open; enter resources for the folder name in this window, then click the "Create" button. You should now have the Resources folder in your project.
Then the way I do this is to use Finder to copy the file to the resource directory of my project.
After the file is in the Resource Directory (in Finder), back to Xcode, select the resource directory in your project:
and again use the menu "File-> Add Files". You should see your file highlighted (affineOutput.txt in this case):
Double click on it and it will become part of the package.
As Milliways says, then check the "Generate Phases" in your project to make sure the file is in the Bundle Copy Resources. If it's somewhere else, just drag it into the Bundle Copy Resources.
source share