Error creating any new XCode project

I am new to Apple development, although I have been writing code on UNIX & Windows for 30+ years. So, I got my Macbook a few months ago, have spent a lot of time going through the tutorials, creating sample projects. Put it down for a few weeks around the holidays, and picked it back up, and voila! Now whenever I create a new project in XCode, I get the following dialog:
_____________________________
Internal Error
Uncaught Exception:
* -[NSCFString substringFromIndex:]: Range or index out of bounds

Stack Backtrace:
The stack backtrace has been logged to the console.
_____________________________

I have run the terminal command to uninstall XCode, and reinstalled it, rebooted, and still have this problem. I'm hoping someone has an idea?

I am running OS X Snow Leopard 10.6.2 with the latest updates (could that be the problem?), XCode 3.2.1 with iPhone SDK. I don't think the Macbook is sulking because I let it sit for a couple of weeks, is it?

Macbook Pro, Mac OS X (10.6.2)

Posted on Jan 21, 2010 7:37 PM

Reply
5 replies

Jan 25, 2010 4:58 PM in response to etresoft

OK, I do have a solution.

First, what I tried that DIDN'T work, was I tried to uninstall XCode and then reinstall it using the following command. This command worked, but it did not solve the problem:

sudo /Developer/Library/uninstall-devtools --mode=all

Next, I found a blog that seemed knowledgeable about development, and asked Rob Napier - he suggested I delete/rename the following files/directories to erase my preferences.

~/Library/Preferences/com.apple.Xcode.plist
~/Library/Caches/com.apple.Xcode
~/Library/Caches/xcodebuild
~/Library/Application Support/Developer/Shared/Xcode/


I then restarted XCode, created a project, and voila! Now I just need to recover all the preferences I had changed, but at least I can trust my builds. Thanks to ALL who responded.

Jan 25, 2010 5:01 PM in response to Jay Imerman

KT, question about backups and snapshots. Backups I think I have down pat, I am using Goodsync, have been using it for years on my PC's, and they came out with a Mac version, so I can sync with folders on my server.

How do you make snapshots? Is that built into Mac OS? How does that work - is it like Windows System Restore (kinda useless, just restores OS settings), or does it restore the entire hard drive to a certain state (thus losing any new work)?

Jan 25, 2010 5:35 PM in response to Jay Imerman

I'm referring to the 'Snapshots' option in Xcode. In the 'file' menu...

See Xcode help for details...


"Snapshots allow you to save project state at particular points in time, which you can restore entirely or partially at a later point. Snapshots provide a multifile undo/redo mechanism that lets you experiment freely with your source files. A snapshot stores the state of a directory tree at the time it was taken. The changes you make can be easily reverted by restoring your project to a snapshot you made before the experiment.
At any particular time, a project can access only one snapshot store. A snapshot store is the set of snapshots taken from one or more projects with the same project root. (See “General Project Attributes” in Xcode Project Management Guide to learn how to set a project’s project root.)"


Options:
- make
- compare
- restore
- delete

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Error creating any new XCode project

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.