Quite often when I code in Xcode, I type no-break space (Option + Space / Option + Shift + Space) especially before or after square brackets or curly braces. This causes Xco
I got rid of this by binding Cancel (Cancellation)
to Esc.
I also had that problem (xCode 7.2) and found a workaround by assigning Option+Space and Option+Shift+Space to "Make Text Writing Direction Left ToRight" in Xcode
You could assign them to any other command that doesn't have a useful effect for you.
It will make it seem that the space bar is not responding when you accidentally hold the modifier keys but that's much less of a time waster than the compilation errors.
Alt+Space command creates a special hidden character in Xcode files. You can see details of bug here.
For more details about solution checkout my answer on Xcode - Invalid character in source file (Replace “ ” with “ ”)