object-c [self class] 和 [self _cmd]
[self class] 返回当前类名
[self _cmd] 返回当前方法名
self 是类的隐藏的参数,指向当前当前调用方法的类
另一个隐藏参数是_cmd,代表当前类方法的selector
object-c [self class] 和 [self _cmd]的更多相关文章
- IMP self _cmd
The only way to circumvent dynamic binding is to get the address of a method and call it directly as ...
- #ifdef,#else,#endif,#if 拾忆
预处理就是在进行编译的第一遍词法扫描和语法分析之前所作的工作.说白了,就是对源文件进行编译前,先对预处理部分进行处理,然后对处理后的代码进行编译.这样做的好处是,经过处理后的代码,将会变的很精短. ...
- ios Object Encoding and Decoding with NSSecureCoding Protocol
Object Encoding and Decoding with NSSecureCoding Protocol February 27, 2014 MISC NSCoding is a fanta ...
- 解决:pipenv shell报错:AttributeError: 'module' object has no attribute 'run'
利用pipenv shell切换到虚拟环境时,显示报错:AttributeError: 'module' object has no attribute 'run' 可以看到是d:\program\p ...
- 好用的一个object c 宏
好用的一个object c 宏 from https://github.com/justzt/ios-helper/blob/master/Macro.h // // Macro.h // Photo ...
- self & _cmd
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles ...
- CoreCLR源码探索(一) Object是什么
.Net程序员们每天都在和Object在打交道 如果你问一个.Net程序员什么是Object,他可能会信誓旦旦的告诉你"Object还不简单吗,就是所有类型的基类" 这个答案是对的 ...
- JavaScript Object对象
目录 1. 介绍:阐述 Object 对象. 2. 构造函数:介绍 Object 对象的构造函数. 3. 实例属性:介绍 Object 对象的实例属性:prototype.constructor等等. ...
- javascript之Object.defineProperty的奥妙
直切主题 今天遇到一个这样的功能: 写一个函数,该函数传递两个参数,第一个参数为返回对象的总数据量,第二个参数为初始化对象的数据.如: var o = obj (4, {name: 'xu', age ...
- c# 基础 object ,new操作符,类型转换
参考页面: http://www.yuanjiaocheng.net/webapi/config-webapi.html http://www.yuanjiaocheng.net/webapi/web ...
随机推荐
- set_include_path详细解释
zendframework的示例index.php里有这样一句 set_include_path('.' . PATH_SEPARATOR . '../library/'. PATH_SEPARATO ...
- python setup.py uninstall
I have installed a python package with python setup.py install How do I uninstall it? ============== ...
- 【SpringMVC】SpringMVC系列5之@RequestHeader 映射请求头属性值
5.@RequestHeader 映射请求头属性值 5.1.概述 请求头包含了若干个属性,服务器可据此获知客户端的信息,通过 @RequestHeader 即可将请求头中的属性值绑定到处理方法的入参中 ...
- iOS 利用self.navigationItem.backBarButtonItem修改后退按钮文字
@property(nonatomic,retain) UIBarButtonItem *backBarButtonItem; // Bar button item to use for the ba ...
- php请求URL中的参数有空格
url=http://www.123.com/abc.php?name=ku xiong ku xiong之间有一个空格,需要替换成%20或者+ url=http://www.123.com/abc. ...
- css3学习总结3--CSS3图像边框
border-image属性 .className{ border-image:url(/course/54d1cae088dba03f2cd1fec1/img/border.png) 20 20 2 ...
- 细胞分裂(codevs 2952)
题目描述 Description 著名生物学家F博士发现了一种单细胞生物. 它长得像蚯蚓,分裂速度极快(每分钟一次),分裂也像蚯蚓一样,断成两段,再长成. 它很好斗,只要q只聚集在一起,就会q只一群打 ...
- cocos2dx创建sprite的多种方法
方法一 最常用,也是最简单的一种方法 CCSprite *bg=CCSprite::create(,,,)); bg->setAnchorPoint(ccp(,)); bg->setPos ...
- 二、JavaScript语言--JS基础--JavaScript进阶篇--流程控制语句
1.if语句--做判断 if语句是基于条件成立才执行相应代码时使用的语句. 语法: if(条件) { 条件成立时执行代码} 注意:if小写,大写字母(IF)会出错! 假设你应聘web前端技术开发岗位, ...
- svn 提交冲突(目录下删除文件)
[root@v01 webtest]# svn ci -m "delete kkk" svn: Commit failed (details follow): svn: Abort ...