Objective-C中一种消息处理方法performSelector withObject
来源:互联网 发布:apache mp4 mime类型 编辑:程序博客网 时间:2024/05/21 22:58
http://www.cnblogs.com/buro79xxd/archive/2012/04/10/2440074.html
[[MethodForSelectors alloc] performSelector:customSelector withObject:0];
这句话应该是有问题的。也懒得验证,反正到时候编译器会报错的。
- (void) performDynamicMethodsViaSelectors {
MethodForSelectors * mfs = [MethodForSelectors alloc];
NSArray *Arrays = [NSArray arrayWithObjects:@"AAA", @"BBB", nil];
for ( NSString *array in Arrays ){
SEL customSelector = NSSelectorFromString([NSStringstringWithFormat:@"abcWith%@:", array]);
mfs = [[MethodForSelectors alloc] performSelector:customSelector withObject:0];
}
}
这里面的,个人认为这句话NSSelectorFromString很牛逼,太灵活了
performSelector:customSelector withObject:
今天刚发现,原来,这个方法,只能传两个参数,最多withObject两次,呵呵,2了一会儿。
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector withObject
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector: withObject:(转)
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector: withObject:
- Objective-C中一种消息处理方法performSelector: withObject:
- ARM Cortex-M3 学习笔记(4-2)
- SPOJ 220 Relevant Phrases of Annihilation(每个字符串至少出现两次且不重叠的最长子串)
- 7、怎样把一个链表掉个顺序
- C++ 字符、字符串与int型数据的转化
- 8、请编写能直接实现 int atoi(const char * pstr)函数功能的代码
- Objective-C中一种消息处理方法performSelector withObject
- [init.rc] android开机过程执行shell脚本
- Python_Syntax
- Objective-C语法快速参考
- Facebook Haystack图片存储架构
- ARM Cortex-M3 学习笔记(5)
- 安装了两个相同版本的APACHE,然后删除后安装的导致第一个无法使用的解决方案
- MyEclipse连接mysql配置教程
- 苹果开发技术: Cocoa 框架概述