Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Renaming Xcode Project

I basically am trying to rename my Xcode Project and I'm getting an error that looks like this.

  • linker command failed with exit code 1 (use -v to see invocation)

ld: file not found: /Users/jonathanfernandez/Library/Developer/Xcode/DerivedData/Sophia-gpxorgzxyjvcaxbnlzoqtnmyhiga/Build/Products/Debug-iphonesimulator/Swift-TableView-Example.app/Swift-TableView-Example

Image Link - http://i.imgur.com/ewg9LIl.png

Why does this happen and what's going on? I'm still kinda new to developing and would appreciate anyone for helping me with this.

Additional Notes:

  • I'm using and customizing a template project I got from gitHub
  • I also receive errors from local project too.

2 Answers

Just change anything back that you already changed, and then in Xcode, click on the .xcodeproj file of your project in the left sidebar, then, after a second or two, click it again. The name of your project should be editable, and you can change it to whatever you want. Make sure to tell Xcode to take a snapshot in the popup window that comes up, then just hit "Change" (or whatever the button's name is), and Xcode will take care of the rest

Hi Michael,

Sorry for the late reply, been really busy and thanks for the feedback.

Actually your suggestion of renaming the project is exactly how I was doing it with snapshots taken place when I was experiencing this error.

Although just now I had attempted it once more and weirdly enough it worked this time with no compile errors. I don't know whether if it was because I had shutdown my computer from last time or if it is a bug from somewhere. Anyway greatly appreciate your time and feedback!
: )

There may be more you need/want to do. I don't remember if not doing the rest of the steps left any residual problems, but you'll find your old name to change in a few more places, at least.

Credit to fs_tigre in this thread, which also describes duplicating projects:

http://stackoverflow.com/questions/17744319/duplicate-and-rename-xcode-project-associated-folders

1- Backup your project. If you are using git, commit any changes, make a copy of the entire project folder and backup in time machine before making any changes.

2- Open your project.

3- Slow double click or hit enter on the Project name (blue top icon) and rename it to whatever you like.

NOTE: After you rename the project and press ‘enter’ it will suggest to automatically change all project-name-related entries and will allow you to de-select some of them if you want. Select all of them and click ok.

4- Rename the Scheme a)Click the menu right next to the stop button and select Manage Schemes. b)Single-slow-click or hit enter on the old name scheme and rename it to whatever you like. c)Click ok.

5 - Build and run to make sure it works.

NOTES: At this point all of the important project files should be renamed except the comments in the classes created when the project was created nor the source folder. Next we will rename the folder in the file system.

6- Close the project.

7- Rename the main and the source folder.

8- Right click the project bundle .xcodeproj file and select “Show Package Contents” from the context menu. Open the .pbxproj file with any text editor.

9-Search and replace any occurrence of the original folder name with the new folder name.

10- Save the file.

11- Open XCode project, test it.

12- Done.