Need Help Reading a File in Xcode

Feynman Eye

macrumors newbie
Original poster
Feb 20, 2015
3
0
Hi,

I am trying to read a file in c Programming using Xcode. I know the basic syntax of going about this task, but the program is unable to find the file I am trying to read. The file does exist and I believe I have placed it in the "Project Directory" folder. I've been trying to get this to work for at least 3 hours in total. The program does compile and build, but it says "Null" in regard to finding the file. Can someone help me?

I have attached a picture of my code and project navigator.

Thanks you.
 

Attachments


subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Hi,

I am trying to read a file in c Programming using Xcode. I know the basic syntax of going about this task, but the program is unable to find the file I am trying to read. The file does exist and I believe I have placed in the "Project Directory" folder. I've been trying to get this to work for at least 3 hours in total. Can someone help me?
You need to change the working directory of Xcode, or use an absolute path to the file.
 

Feynman Eye

macrumors newbie
Original poster
Feb 20, 2015
3
0
You need to change the working directory of Xcode, or use an absolute path to the file.

Thank you for replying. How do I go about changing the working directory of Xcode. I have been trying to do that for the past hour.
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Thank you for replying. How do I go about changing the working directory of Xcode. I have been trying to do that for the past hour.
I believe it's in edit scheme, alternatively it may work to drop it into products where the executable file is.
 

Feynman Eye

macrumors newbie
Original poster
Feb 20, 2015
3
0
I believe it's in edit scheme, alternatively it may work to drop it into products where the executable file is.
I have tried dropping it into Product, it gave me the same results. What do I do exactly in edit scheme?

----------

You need to change the working directory of Xcode, or use an absolute path to the file.
Thank you, so much!! I finally got it to work. :D:D:D:D:D