Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find missing files in Xcode

Tags:

xcode

ios

I am re-arranging files in my file system for my Xcode projects. Therefore, when I open the Xcode project, all of the files are red.

I can add each file manually, but is there a way for Xcode to quickly find these files for me? All of the files are located in one directory.

like image 849
xonegirlz Avatar asked May 31 '12 00:05

xonegirlz


People also ask

How do I add missing files to Xcode?

Select all the missing files that are in one folder in Finder. 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. Show activity on this post.

Where can I find Xcode files?

In xcode on left pane in the project navigator at the bottom there is a search field. In the documentation it is called filter bar. According to Inder Kumar Rathore the shortcut is ⌘ + ⇧ + O .

How do I search all projects in Xcode?

Find Text or Patterns in Your Source Code To find text in a file, open the file in the Xcode source editor and choose Find > Find from the menu bar. Xcode displays the Find bar and its search controls at the top of the file. Enter a search term. Xcode searches the file, highlights matches, and notes how many it finds.


2 Answers

If you have a bunch of missing (red) files that now live in the same directory, you can improve on the "fix each path individually in the inspector" method by selecting (Cmd-click) all the files at once. You'll see "multiple values" in the inspector, like so:

Xcode screenshot: Multiple Values

Clicking the button under the Location dropdown will bring up a directory selector -- note that the prompt says "Choose folder containing..." rather than "Choose file and location".

enter image description here

like image 69
Alex Michaud Avatar answered Sep 18 '22 17:09

Alex Michaud


As far as I know, Xcode doesn't have a way to automatically locate moved files. You can reconnect a reference to its file using the Inspector (panel on the right) but it is somewhat tedious to do so. In your case, it would probably be faster to simply delete the references and then add the files back to your project.

like image 37
benzado Avatar answered Sep 17 '22 17:09

benzado