Xcode not compiling any project? 'clang failed with exit code 255'
This is happening because your OS X install is running into the per-user process limit. And that's happening because XCode doesn't always cleanly kill your process at the end of a debugging session.
On my machine, I have 709 processes allowed per user:
El Smeg:~$ sysctl kern.maxprocperuid
kern.maxprocperuid: 709
Looking at the number of zombied processes on my machine:
El Smeg:~$ ps aux | grep \(GridView\) | wc -l
608
So you can see that I'm pretty close to the per-user process limit just due to XCode leaving zombie processes around.
Unfortunately, I don't see a good way to kill these off. kill -9 doesn't work. Rebooting seems to be the only fix aside from temporarily raising your per-process limit, which isn't really a fix. You can't kill the parent process because that's launchd and killing that is pretty much equivalent to a reboot anyway.
I just had that same error, same situation(the code worked totally fine, then suddenly has that error message). For me I just closed the simulator and opened it again then xCode does not complain anymore.
Have you tried to run your code in device?