How to tell Xcode where my info.plist and .pch files are

前端 未结 7 1540
轻奢々
轻奢々 2020-12-02 10:28

I renamed my project and it\'s files and now Xcode is still looking for the old info.plist file. Where do I set the locations of the .plist and .pch files that it needs.

相关标签:
7条回答
  • 2020-12-02 10:41

    I know this answer is answered and closed, but I'm going to add my discoveries here as it is slightly different for Xcode 4.2:

    • Select your project
    • In the left side of the middle pane, select your app under "Targets"
    • Select the tab "Build Settings"
    • Search the following keywords: "info.plist" and "pch"
    • At this point it should be pretty clear which are the ones you need to modify.
    • Click on "Validate Settings" and you're done.
    0 讨论(0)
  • 2020-12-02 10:41

    One more wrinkle to this. It still would not find the new plist file because it was in a folder inside the main project hierarchy on my disk. In this case, the name you should put in the build settings is relative to the project file, like "FolderName/Info.plist" for example.

    0 讨论(0)
  • 2020-12-02 10:41

    I am working with Xcode 9.3 and "boldly" changed my app name without understanding that I was inviting trouble: I got it.

    Fortunately, it is now easy to rename a project or app with reliable results if in Xcode you select the blue icon on the left/in the project navigator and then edit the "Identity and Type" "Name" field in the "File Inspector". This brings up a dialog, and clicking on "Rename" works reliably.

    0 讨论(0)
  • 2020-12-02 10:45

    Found it. It was in the settings for the Target.

    • Choose Target in the Groups and Files pane on the left.
    • Right-Click and choose Get Info
    • Search for "Info.Plist" and type in the filename for the correct plist file into the property of the item named "Info.Plist File".
    • Then search for "Prefix" and find the item named "Prefix Header".
    • Change it's property to the name of the correct .pch file that you are using.

    I think these different "Info" windows are confusing. You have to make sure the right file is selected in the Groups and Files pane before selecting "Get Info", and it's hard to tell if what you're doing is actually making changes to the Info.plist file, or where your changes are being saved.

    0 讨论(0)
  • 2020-12-02 10:56

    Just close project and reopen it. Then you will see on the project target, choose plist button on the General tab See this screenshot to make sense

    0 讨论(0)
  • 2020-12-02 11:00

    I know this is an old post, but I just ran into this same problem using Xcode 8.2. I had already duplicated .plist and .storyboard files in finder, but my Xcode project did not pick them up. In order to add files to your xcodeproj just right click on the project or folder in the Project Navigator and select Add Files to "Your Project Name". You should be able to select the files you need (use Cmd key to select multiple individual files).

    If you created a new .plist or .storyboard file you'll need to link to your target membership. To link just click on the file in the navigator and on the right hand side in your standard editor > file inspector > target membership select the appropriate target membership.

    The correct way to do this without duplicating files in finder is by selecting the file to duplicate and then going to File > Duplicate on the Xcode navigation menu.

    0 讨论(0)
提交回复
热议问题