OBJC 格式化字符串

来源:互联网 发布:老板电器 知乎 编辑:程序博客网 时间:2024/06/05 06:00

OBJC 格式化字符串放这里。方便以后速查。

这是文档URL
file:///Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiOS4_2.iOSLibrary.docset/Contents/Resources/Documents/documentation/Cocoa/Conceptual/Strings/introStrings.html#//apple_ref/doc/uid/10000035-SW1


Specifier
Description
%@
Objective-C object, printed as the string returned by descriptionWithLocale: if available, or description otherwise. Also works with CFTypeRef objects, returning the result of the CFCopyDescription function.
%%
'%' character
%d, %D, %i
Signed 32-bit integer (int)
%u, %U
Unsigned 32-bit integer (unsigned int)
%hi
Signed 16-bit integer (short)
%hu
Unsigned 16-bit integer (unsigned short)
%qi
Signed 64-bit integer (long long)
%qu
Unsigned 64-bit integer (unsigned long long)
%x
Unsigned 32-bit integer (unsigned int), printed in hexadecimal using the digits 0–9 and lowercase a–f
%X
Unsigned 32-bit integer (unsigned int), printed in hexadecimal using the digits 0–9 and uppercase A–F
%qx
Unsigned 64-bit integer (unsigned long long), printed in hexadecimal using the digits 0–9 and lowercase a–f
%qX
Unsigned 64-bit integer (unsigned long long), printed in hexadecimal using the digits 0–9 and uppercase A–F
%o, %O
Unsigned 32-bit integer (unsigned int), printed in octal
%f
64-bit floating-point number (double)
%e
64-bit floating-point number (double), printed in scientific notation using a lowercase e to introduce the exponent
%E
64-bit floating-point number (double), printed in scientific notation using an uppercase E to introduce the exponent
%g
64-bit floating-point number (double), printed in the style of %e if the exponent is less than –4 or greater than or equal to the precision, in the style of %f otherwise
%G
64-bit floating-point number (double), printed in the style of %E if the exponent is less than –4 or greater than or equal to the precision, in the style of %f otherwise
%c
8-bit unsigned character (unsigned char), printed by NSLog() as an ASCII character, or, if not an ASCII character, in the octal format //ddd or the Unicode hexadecimal format //udddd, where d is a digit
%C
16-bit Unicode character (unichar), printed by NSLog() as an ASCII character, or, if not an ASCII character, in the octal format //ddd or the Unicode hexadecimal format //udddd, where d is a digit
%s
Null-terminated array of 8-bit unsigned characters. %s interprets its input in the system encoding rather than, for example, UTF-8.
%S
Null-terminated array of 16-bit Unicode characters
%p
Void pointer (void *), printed in hexadecimal with the digits 0–9 and lowercase a–f, with a leading 0x
%L
Length modifier specifying that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument
%a
64-bit floating-point number (double), printed in scientific notation with a leading 0x and one hexadecimal digit before the decimal point using a lowercase p to introduce the exponent
%A
64-bit floating-point number (double), printed in scientific notation with a leading 0X and one hexadecimal digit before the decimal point using a uppercase P to introduce the exponent
%F
64-bit floating-point number (double), printed in decimal notation
%z
Length modifier specifying that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument
%t
Length modifier specifying that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned integer type argument
%j
Length modifier specifying that a following d, i, o, u, x, or X conversion specifier applies to a intmax_t or uintmax_t argument

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 土地确权后没有土地的人怎么办 老板不发工资跑路了怎么办 别人登录了我的美团账号怎么办 月嫂家政公司快坚持不下去了怎么办 华硕飞马4a手机发热怎么办 超级必发指数手机页面没曲线怎么办 唐小僧理财暴雷了投资者该怎么办 教师资格证面试准考证号忘了怎么办 初中学校说处分不给毕业证怎么办? 自动档一键打火的车没电了怎么办 物流代收货款一直拿不到钱怎么办 丰巢快递柜收不到验证码怎么办 拼多多三级惩罚下架3天怎么办 在万达买的衣服穿一次烂了怎么办 内蒙古对于没有地的农民改怎么办 微信号码重新注册后回零钱怎么办 安卓系统文件苹果手机打不开怎么办 课题必须发表论文吗?查重怎么办 学信网学籍绑定输错5次怎么办 大学学校图书馆借的书丢了怎么办 借阅机里的图书不显示书名怎么办 苹果6s锁屏密码忘了怎么办 父亲去世后妈将父亲存款带走怎么办 狗和别的狗打架腿瘸了怎么办 神经病砍人警察不积极处理怎么办 才买了车里面的气味很大怎么办 家里装修两年了很大的木味怎么办 装修一年的房子夏天味很大怎么办 死了怕下地狱活着又受煎熬怎么办 狗狗的疫苗证丢了怎么办 剃了毛的狗不睡觉怎么办 家里的小狗送人了孩子一直哭怎么办 半个月的小狗一天没拉屎怎么办 把狗狗的毛剃了怎么办 用了维a酸乳膏过敏怎么办 药水点痣留下的红印怎么办 小孩牙齿被虫子吃了个洞怎么办 一岁宝宝贫血值是84怎么办 荒岛求生手机版被困在石室里怎么办 工伤认定期间被厂里辞退工资怎么办 怀孕50天看恐怖片肚子阴痛怎么办