这在 Swift 的第一个测试版中有效。
var degree = "\u00B0" // degree symbol
现在我遇到了这个错误,我不明白我需要做什么才能在 Xcode 6 Beta 5 中更正它。
Expected hexadecimal code in braces after unicode escape
最佳答案
正确的代码是:
var degree = "\u{00B0}" // degree symbol
来自 Xcode 6 beta 4 发行说明:
The \x, \u and \U escape sequences in string literals have been consolidated into a single and less error prone \u{123456} syntax. (17279286)
关于swift - unicode转义后大括号中的预期十六进制代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25225074/