How do I escape a Unicode character in my Objective-C source code?

前端 未结 5 1707
北恋
北恋 2020-12-06 04:00

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

I have a Unicode character I want to insert into a string li

5条回答
  •  爱一瞬间的悲伤
    2020-12-06 04:39

    If you don't want to put it directly in your string you can use a format specifier like this:

    [string stringByAppendingFormat:@"%C", 0x2665];
    

提交回复
热议问题