Xcode Crash Loop – countByEnumeratingWithState

Posted on 6 August, 2010

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

Uncaught Exception:
-[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.

xcode_crash

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:

plist

Hope it helps others to avoid some hair-pulling…

Comments are closed.