好吧,我正在创建一个自定义 SEL,例如:
NSArray *tableArray = [NSArray arrayWithObjects:@"aaa", @"bbb", nil];
for ( NSString *table in tableArray ){
SEL customSelector = NSSelectorFromString([NSString stringWithFormat:@"abcWith%@", table]);
[self performSelector:customSelector withObject:0];
}
我收到一个错误: 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:'-[Sync aaaWithaaa]:无法识别的选择器已发送到实例
但如果我用真实的方法名运行它,它就可以工作!
[self performSelector:@selector(aaaWithaaa:) withObject:0];
如何解决?