我打电话
[delegate addText:button.titleLabel.text withSelector:@selector(addElement:) fromKeyboard:self.name]
对应于
- (void)addText:(NSString *)text withSelector:(SEL)selectorName fromKeyboard:(NSString *)name {
[tempData performSelector:@selector(selectorName) withObject:text];
}
但是,当我在 tempData 上调用执行选择器方法时,出现错误。当我用 (addElement:) 替换 selectorName 时,它工作正常。