NSLog各种打印占位符

2021-01-12 22:15:46

参考地址 NSLog各种打印

%@ 对象

%d,%i 整型 (%i的老写法)

%hd 短整型

%ld , %lld 长整型

%u 无符整型

%f 浮点型和double型

%0.2f 精度浮点数,只保留两位小数

%x:    为32位的无符号整型数(unsigned int),打印使用数字0-9的十六进制,小写a-f;

%X:    为32位的无符号整型数(unsigned int),打印使用数字0-9的十六进制,大写A-F;

%o 八进制

%zu size_t

%p 指针地址

%e float/double (科学计算)

%g float/double (科学技术法)

%s char *  字符串

%.*s Pascal字符串

%c char 字符

%C unichar

%Lf 64位double

%lu sizeof(i)内存中所占字节数

打印CGRect : NSLog(@"%@",NSStringFromCGRect(someCGRect)); 或者CFShow(NSStringFromCGRect(someCGRect));

打印CGSize: NSLog(@"%@",NSStringFromCGSize(someCG Size ));

  • 2017-11-06 01:00:17

    撤销git add

    如何撤销git add,不小心执行了git add . 操作,但是又不能提交所有的文件,因为对应不同的分支,现在怎么样可以将git add 撤销回来

  • 2017-11-10 00:06:15

    CORS: credentials mode is 'include'

    XMLHttpRequest cannot load http://localhost/Foo.API/token. The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:5000' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.