我的Objective-C源代码中如何避免Unicode字符? [英] How do I escape a Unicode character in my Objective-C source code?

查看:120
本文介绍了我的Objective-C源代码中如何避免Unicode字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得这是非常愚蠢的,但文档和Google根本没有给我任何爱。

I feel incredibly stupid for asking this, but the documentation and Google are giving me no love at all.

我有一个Unicode字符,我想插入到我的iPhone应用程序的源代码中的字符串字面值。我知道它的十六进制值。什么是正确的转义序列使用?对于这个问题,我忽略了什么明显的信息来源呢?

I have a Unicode character I want to insert into a string literal in the source code of my iPhone app. I know its hex value. What is the proper escape sequence to use? And for that matter, what obvious source of information am I overlooking that would have told me this?

推荐答案

示例:

NSString *stuff = @"The Greek letter Beta looks like this: \u03b2, and the emoji for books looks like this: \U0001F4DA";

这篇关于我的Objective-C源代码中如何避免Unicode字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆