Yep it happens, and it’s ugly. I am documenting the stept it took me to solve this matter hoping that it will be helpful for other devs too.
Xcode started to crash as soon as I used “Build and Archive” with a specific project. The messages was
-[NSCFString countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance xxx
Turns out tat the Organizer leads to the crash. The only problem is that once you opened the Organizer and Xcode crashes, it enters an evil crash loop because every time you restart it – the Organizer is displayed first.
Needless to say that this is annyoing at least.
First I had to delete the faulty archived build from ~/Library/MobileDevice/Archived Applications/.
The reason for the crash was a malformed plist inside my project. For an iPhone app that specifies an extra icon for the iPhone 4 Retina Display the key “CFBundleIconFiles” contained a comma separated string instead of an array…
Here is a snippet of the proper format:
Hope it helps others to avoid some hair-pulling…