iPhone开发笔记——performSelector使用
//无参数
-(void)noParam;
//一个参数
-(void)oneParam:(NSString *)oneParam;
//两个参数
-(void)oneParam:(NSString *)oneParam twoParam:(NSString*)twoParam;
//注:最多支持两个参数,参数必须是对象,可以用指针表示
[self performSelector:@selector(noParam) withObject:nil];
[self performSelector:@selector(oneParam:)withObject:oneParam];
[self performSelector:@selector(oneParam:twoParam:)withObject:oneParam withObject:twoParam];
//多参数
//最多只能支持两个参数,因此多参数只能别想办法
//将参数放在数组中,然后使用一个参数的使用方法可以实现
-(void)multiParam:(NSArray *)paramArray;
[self performSelector:@selector(multiParam:)withObject:paramArray];