user3151675
user3151675

Reputation: 58149

"Non-breaking space (U+00A0) used instead of regular space" warning in 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?

Upvotes: 22

Views: 22875

Answers (1)

user3151675
user3151675

Reputation: 58149

That happens to me when I type too fast and accidentally hold down Option 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 Settings/Key Bindings, so it enters a tabulator character instead.

Upvotes: 42

Related Questions