My app needs to read a text file so I added the file to the project folder, using "Copy Bundle Resources" in the "Build Phases" of the test target. I can see the file in the Xcode project structure, but when I debug the app, it shows the string is nil
. I found a related question but it didn't solve this.
Asked
Active
Viewed 105 times
0

jscs
- 63,694
- 13
- 151
- 195

anbu selvan
- 725
- 3
- 13
- 41
-
Did you add the file to the specific target? – André Slotta Mar 18 '18 at 11:04
-
1I guess you should add the txt file to the `Copy Files` build phase (create one if it's not present) instead of the `Copy Bundle Resource` phase of the appropriate target – Dániel Nagy Mar 18 '18 at 13:24
-
Thanks #Daniel Nagy that worked. – anbu selvan Mar 18 '18 at 13:53