Need Help Reading a File in Xcode

Discussion in 'Mac Programming' started by Feynman Eye, Feb 20, 2015.

  1. Feynman Eye macrumors newbie

    Joined:
    Feb 20, 2015
    #1
    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.
     

    Attached Files:

  2. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #2
    You need to change the working directory of Xcode, or use an absolute path to the file.
     
  3. Feynman Eye thread starter macrumors newbie

    Joined:
    Feb 20, 2015
    #3

    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.
     
  4. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #4
    I believe it's in edit scheme, alternatively it may work to drop it into products where the executable file is.
     
  5. Feynman Eye thread starter macrumors newbie

    Joined:
    Feb 20, 2015
    #5
    I have tried dropping it into Product, it gave me the same results. What do I do exactly in edit scheme?

    ----------

    Thank you, so much!! I finally got it to work. :D:D:D:D:D
     

Share This Page