Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Non-breaking space (U+00A0) used instead of regular space" warning in Xcode

Tags:

xcode

When typing a space character in Xcode, a warning appears sometimes:

Non-breaking space (U+00A0) used instead of regular space

Earlier Xcode versions display these messages:

Treating Unicode character as whitespace

or

Invalid character in source file

If I re-write the character, the warning disappears. What causes this?

like image 828
Tamás Sengel Avatar asked Apr 04 '15 10:04

Tamás Sengel


1 Answers

That happens to me when I type too fast and accidentally hold down Alt while pressing down Space. This creates a non-breaking space (0xA0) which is not recognized as a valid space character by Xcode.

For a (hacky) solution, I've remapped this combination to Insert Tab inside Xcode's Preferences/Key Bindings, so it enters a tabulator character instead.

like image 131
Tamás Sengel Avatar answered Sep 19 '22 14:09

Tamás Sengel