Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to quickly add back missing file in xcode

Tags:

xcode

I zipped up my project folder in xcode and moved it to a new computer. When I open up the project it has missing files (file appears red).

How can I add all these files back or re-link them. It is like 20+ files?

Why didnt xcode store the relative path?

like image 416
Arcadian Avatar asked Dec 13 '22 18:12

Arcadian


2 Answers

Xcode may not update location for some files of your project when you copy/move it from one environment to another. The easiest way I found is something like this:

1-Select your files like this, if they are in different groups, then repeat the flow on each group separately:

enter image description here

2- Show the file inspector:

enter image description here

3- You may notice Xcode has an absolute path for them, which is something not useful, so click on the little icon near Multiple Values. navigate to the folder where your selected files are stored in the finder and click "Choose".

Also, don't forget to change the Location to Relative to Project. Now you will get something like this:

enter image description here

like image 154
Malloc Avatar answered Jan 19 '23 09:01

Malloc


• Select all the missing files that are in one folder in Finder.

• Change Location to Relative to Group ( that's in the File Inspector View -> Utilities -> Show File Inspector )

• Click the choose file button; it is under the Location drop down menu; it is an image that looks like a very small window with a document inside it.

A Choose folder containing the selected references sheet should appear.

• find and select the folder containing the missing files in the finder, then click Choose

(Tested in In xCode v4.3.2)

like image 26
thisma Avatar answered Jan 19 '23 10:01

thisma