类方法中self的用法
来源:互联网 发布:制作传单的软件 编辑:程序博客网 时间:2024/06/04 23:26
If you are calling another class method from inside a class method (of the same class) you can just use [self classMethod]
. If however you are in an instance method and you need to call that classes class method you can use [[self class] classMethod]
+ (NSArray *)rankString
{
return@[@"?", @"A", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9", @"10", @"J", @"Q", @"K"];
}
+ (NSUInteger)maxRank
{
return ([当前类rankString].count - 1);
//用self也可以正常工作,比如return ([selfrankString].count -1);
}
0 0
- 类方法中self的用法
- ios中self的用法
- ios中self的用法
- Python类中方法的self参数
- iOS开发中类方法与self方法的区别
- objective-c中self.的用法
- Objective-C 中关于self的用法
- php中self和$this的用法
- Block中weak/strong self的用法
- php中self 、parent的用法
- ios开发中类方法以及self的注意点
- ios开发中类方法以及self的注意点
- ios中self.用法
- self的用法
- ios的self.用法
- ios的self.用法
- self的用法
- @synchronized(self)的用法
- Project Euler 26 计算小数位循环的位数
- ubuntu安装指南
- apache外网不能访问即解决方式
- HDU 3966 树链剖分
- POJ 2516 Minimum Cost(网络流之费用流)
- 类方法中self的用法
- Java 语言和 Java Media
- 筛选法求素数
- opencv求矩阵特征值
- 使用命令启动openOffice
- chrome小不懂。(持续更新...)
- sublime text2 插件安装
- 使用struts、hibernate、spring进行框架整合流程详细说明(完整版)附:开发规范
- 防撞扶手使用效果明显