9

If I change the name of my iOS project in XCode either in in the navigator view:

What is the equivalent of Project->Rename in Xcode 4

Or in the Inspector, like this:

http://woolybeastsoftware.com/woolyblog/2012/01/22/xcode-4-renaming-projects/

...XCode quits unexpectedly? Anybody run into this problem?

Why does this happen and how can you avoid it?

Community
  • 1
  • 1
Josh Elias
  • 3,250
  • 7
  • 42
  • 73
  • Check this question http://stackoverflow.com/questions/12848712/changed-project-name-in-xcode-causing-naming-error. Do the same steps and use your previous project name in those steps to search. – iDev Jan 17 '13 at 18:21
  • I'm not sure where my product name appears in build settings, even after searching. – Josh Elias Jan 17 '13 at 18:29
  • I meant follow the answer. Use the same steps. But search for your previous project name there instead of `Myapp-temp-caseinsensitive-rename`. – iDev Jan 17 '13 at 18:33
  • Yes, searching in build settings is one of those steps. – Josh Elias Jan 17 '13 at 19:28
  • That was just a comment posted by me. In your case, you cant use it since your project file might have got corrupted due to which you cant open the project. Since your case is different from what was there, I have posted a modified version of the answer here. – iDev Jan 17 '13 at 19:50
  • This bug is back in the latest version of Xcode 6.3 (6D570) – malhal Apr 16 '15 at 16:31

3 Answers3

6

If your Xcode project is corrupted, you can do the following,

  • In finder, right click on your .xcodeproject file and click on show package contents.
  • Then right click on your project.pbxproj and open it in some text editor.
  • Then search for the previous project name which you used and manually rename it to the new name.
  • Save it after changing and then reopen the project.

The reason is because your project.pbxproj file which stores all details related to the project got corrupted which causes the Xcode to not able to parse it and hence it crashes. Ideally this shouldn't happen while renaming, but in your case somehow it got corrupted. –

iDev
  • 23,310
  • 7
  • 60
  • 85
  • The question isn't how to do fix it after it crashes, it's why the crash occurs in the first place. Good info anyway though thank you :) – Josh Elias Jan 18 '13 at 21:07
  • The reason is because your .pbxproject file which stores all details related to the project got corrupted which causes the Xcode to not able to parse it and hence it crashes. Ideally this shouldn't happen while renaming, but in your case somehow it got corrupted. – iDev Jan 18 '13 at 21:24
  • After opening the project.pbxproj file it contains multiple filenames of different viewcontrollers having same name as of my project. And it do not contains a filename with extension .xcodeproj. So what should I do in that case? – ViruMax May 11 '15 at 04:37
0

There is a more simpler way: go to Build Settings -> search for "Product Name" and rename it.

Alexander Schwarzman
  • 1,639
  • 1
  • 13
  • 17
0

I got this problem after upgrading to Xcode 6.3. After downgrading to 6.2 it worked fine again. So it seems that some versions of Xcode handle renaming better than others. You find an old version here: https://developer.apple.com/downloads/index.action?name=Xcode Hope this can help someone.

turingtested
  • 6,356
  • 7
  • 32
  • 47