转载自:http://blog.sina.com.cn/s/blog_61235faa0100z0t9.html
NSLog(@"%@",NSStringFromCGRect(pickerView.frame));
或者
CFShow(NSStringFromCGRect(pickerView.frame));
打印
CGSize
:
NSLog(@"%@",
NSStringFromCGSize(someCG Size ));
NSLog的格式如下所示:
- %@ 对象
- %d, %i 整数
- %hi 短整型
- %lli 长整型
- %u 无符整形
- %f 浮点/双字
- %0.2f 精度浮点数,且只保留两位小数
- %x, %X 二进制整数
- %o 八进制整数
- %zu size_t
- %p 指针
- %e 浮点/双字 (科学计算)
- %g 浮点/双字 科学技术法(用最简短的方式)
- %s C (char*)字符串
- %.*s Pascal字符串
- %c 字符
- %C unichar
- %lld 64位长整数(long long)
- %llu 无符64位长整数
- %Lf 64位双字
- %lu sizeof(i)内存中所占字节数
还有类似某些对象,例如CGRect,CGSize等
打印
CGRect :
NSLog(@"%@",NSStringFromCGRect(someCGRect));
打印
CGSize
:
NSLog(@"%@",NSStringFromCGSize(someCG Size ));
其他的是:
<code style="padding: 0px; border-width: 0px; margin: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu sans Mono', 'Bitstream Vera sans Mono', 'Courier new', monospace, serif; vertical-align: baseline; background-color: rgb(238, 238, 238);"><span style="color: rgb(43, 145, 175); padding: 0px; border-width: 0px; margin: 0px; vertical-align: baseline; background-color: transparent;"><code style="padding: 0px; border-width: 0px; margin: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu sans Mono', 'Bitstream Vera sans Mono', 'Courier new', monospace, serif; vertical-align: baseline;"><span style="padding: 0px; border-width: 0px; margin: 0px; display: inline-block; vertical-align: baseline; background-color: transparent;"></span></code>NSStringFromCGPoint</span><span style="padding: 0px; border-width: 0px; margin: 0px; vertical-align: baseline; background-color: transparent;"> <wbr> </wbr></span><span style="color: rgb(43, 145, 175); padding: 0px; border-width: 0px; margin: 0px; vertical-align: baseline; background-color: transparent;">NSStringFromCGAffineTran<wbr>sform</wbr></span><span style="padding: 0px; border-width: 0px; margin: 0px; vertical-align: baseline; background-color: transparent;"> <wbr> <wbr> <wbr></wbr></wbr></wbr></span><span style="color: rgb(43, 145, 175); padding: 0px; border-width: 0px; margin: 0px; vertical-align: baseline; background-color: transparent;">NSStringFromUIEdgeInsets</span></code>