Xcode keeps getting headers from other folders

Posted on 2011-10-21
Last Modified: 2012-05-12
I'm using Xcode 4.2.  For some reason, when I build, it is looking at archived header files in folders outside of my project folder.  I don't see that this archive folder is referenced in any of my project paths.  The archive folder is basically an older copy of my current project folder.  Xcode finds the same header file in this archive and throws a compile error since that creates a duplicate interface.  

How can I find out why Xcode is doing this?
Question by:brettr
    LVL 33

    Accepted Solution

    I'd open the project file in TextEdit and look for these problematic files there:
    In Finder select MyProject.xcodeproj file, then "Show Package Contents" from the popup menu, then, in project.pbxproj file, you can see all referenced files. Make a backup copy of your project before.

    Makes sense to check the project settings in Xcode - that you, by mistake,  didn't add the archive folder as a search folder.

    If, for example, a.h is a problem header file, find it in Xcode and select in the left panel and check how "Show in Finder" from the popup menu works for this file - it should go to the file loaded in the correct folder and not in an archive.

    If you import a header file located in folder A to an m-file located in folder B, you can add a path:
    #import "../A/a_header_file.h"

    Author Comment

    Thanks.  Great help.  I can see in the pbxproj file there are several referenced in this other folder.  Then I go to the project as you mentioned and select one of those files.  Sure enough, Finder opens them in the archive folder.  I'm still working through to resolve it and will accept your answer once I'm past all this.

    Do you have any idea how these files got so crossed up?
    LVL 33

    Expert Comment

    You are welcome.
    I don't know why it happened. :(

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Suggested Solutions

         Intro      In this article, I will show you how to parse a JSON in Swift using an open source library called SwiftyJSON ( If you haven't heard of a JSON before, it stands for JavaScript Object Notation…
    You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now