move xcode project causes red text (missing files from project)

后端 未结 13 1289
有刺的猬
有刺的猬 2020-12-08 13:53

When I move iphone project directory to a new path. There are some red texts indicate the missing files from the project source codes. How to avoid these?

13条回答
  •  情话喂你
    2020-12-08 14:40

    1. In Finder, create a duplicate of the project directory just in case all goes squiffy.
    2. In Finder, open the project directory that contains all the files with red references
    3. For all the red files you see in XCode, except the info.plist file (see step 5 below), highlight them in Finder and drag them from Finder to XCode's project navigator. i.e. import them.
    4. In XCode's "Choose options for adding these files" window: a) Select Copy items into Destination's group folder (if needed) b) Select Create groups for any added folder c) Select Add to Targets, and press Finish
    5. Highlight and drag the info.plist file from Finder to Project Navigator and repeat step 4 WITHOUT selecting Add to Targets
    6. If you had groups in Project Navigator (e.g. Supporting Files), reorder the files to be in the right places.
    7. Delete the original bad red references in Project Navigator, and Cmd-Shift-K to clean for good measure.
    8. Build and run on a device to remove the bad reference to the .app file

提交回复
热议问题