NSLog中的%@
2024-10-19 02:18:04
【NSLog中的%@】
There is one additional substitution token available in Objective-C, %@, used to denote an object. At runtime, this specifier will be substituted with the result of calling either the descriptionWithLocale: method (if it exists) or the description method on the provided object. The description method is implemented by NSObject to return the class and memory address of the object, but many Cocoa and Cocoa Touch classes override it to provide more useful information. In the case of NSString, the description method simply returns the string of characters that it represents.
NSLog与printf相比,添加了%@这么一个输出格式,%@对应的对象在编译后会被替换为对descriptionWithLocal方法的调用,如果此方法不存在,则替换为description方法的调用 。
最新文章
- 期许伟大-基于CMMI的过程改进之道探索
- cocoaPod的使用
- CSS浮动属性Float介绍
- 解决 Cannot find OpenSSL&#39;s <;evp.h>;
- WordPress主题制作函数
- laravel事务小例子
- JAVA中集合输出的四种方式
- [SQL]sql语句中charindex的用法
- SendMail
- 检测CPU是否支持虚拟化
- spring schema自定义
- 图片转换成Base64编码集成到html文件
- 用SSE指令计算点乘和累加
- Zookeeper(一) —— 环境搭建
- 基于Web的漏洞利用
- Zabbix安装部署(CentOS系统下)
- 【总结】 Lucas定理
- python猜数字(多种实现方法)
- 6/2 sprint2 看板和燃尽图的更新
- 再谈zabbix 邮件通知配置(不用脚本,简单配置就可以了)