KVC调用方法列表
作者: Cocoa China 【最热的Mac, iPhone专业开发论坛】【本文永久地址】
11
Jun
上篇文章中我们提到,KVC模型在查找方法的时候,会查找诸如get***或者_***这种方法。
其实,KVC查找的形式还有很多,下面列出了所有KVC查找的方法形式,在程序中实现或者调用下面这些方法,都可以直接生成KVO通知(%s用于替换你定义的key):
- validate%s:error:
- %sForKeyPath:
- _%sForKeyPath:
- get%s
- is%s
- _get%s
- countOf%s
- objectIn%sAtIndex:
- %sAtIndexes:
- get%s:range:
- enumeratorOf%s
- memberOf%s:
- _is%s
- set%s:
- _set%s:
- getPrimitive%s
- primitive%s
- setPrimitive%s:
- add%sObject:
- remove%s:
- remove%sObject:
- add%s:
- intersect%s:
- insertObject:in%sAtIndex:
- insert%s:atIndexes:
- removeObjectFrom%sAtIndex:
- remove%sAtIndexes:
- replaceObjectIn%sAtIndex:withObject:
- replace%sAtIndexes:with%s:
发表评论