How can I change the location of files in xcode project?

前端 未结 5 2266
故里飘歌
故里飘歌 2020-12-17 09:57

I put some files on the same level of *.xcodeproj file carelessly. When I move these files into the right location in Finder, Xcode tells me that these files a

相关标签:
5条回答
  • 2020-12-17 10:15

    I found the answer.

    3 things

    1 removed the reference to the red files then dragged them back into the project relinked all my .m and .h files just incase

    2 then removed the .app reference and dragged it back in to the project.

    3 removed any duplicates or red files in the build phases

    Fixed Thanks everyone for your suggestions and help

    0 讨论(0)
  • 2020-12-17 10:15

    From my point of view i would definitely avoid the virtual folders in the Xcode.The disadventage of this approach is whe nthe project gets bigger and bigger you can not find corresponding files in your filesystem easy.Even you click on "Show in finder" you need to look for the file among tens of files.

    My approach is creating the folder in the finder and then dragging it to project.when i need to create a new file in this subfolder is will be added there anyhow.

    0 讨论(0)
  • 2020-12-17 10:19

    When you see a file that is red (or in the wrong place), you can easily correct the location of these files by using the file inspector (which appears along the right side panel of your Xcode window).

    It looks like this:

    Use File Inspector to fix path

    Clicking on the Folder icon next to the name will bring up an open panel from which you can choose the correct location of the file.

    0 讨论(0)
  • 2020-12-17 10:27

    There is an easier way to re-organize files through the Xcode project. You can use Synx, it automatically fixes file paths, through the Xcode project groups.

    You can check Github page for Synx

    Synx

    After intalling Synx just run the command below

    synx path/to/my/project.xcodeproj

    0 讨论(0)
  • 2020-12-17 10:27
    1. Drag the new files from the finder to the Xcode project file structure.
    2. Remove the old files.
    0 讨论(0)
提交回复
热议问题