iPhone:带有属性的类别+“无法识别的选择器发送到实例”例外

首先,我看到有很多关于“无法识别的选择器发送到实例”的问题。 我见过很少,但没有看到访问类别属性中定义的... 我在UILabel上有一个属性的类别。 确定了getter和setter。 实际上我在2个不同的类别中拥有相同的属性(对于2个不同的类别:UIButton和UILabel)。 问题是我可以为UIButton访问此属性,但不能访问UILabel。 一旦我尝试访问UILabel(文本)类别中的任何方法/属性,它就会删除“ - [UILabel test]:无法识别的选择器发送到实例0x4e539f0”异常。 两个类别文件都已导入。 我不知道是什么问题。 这是一些代码:
// UILabel+text.h
@interface UILabel (text)
  - (void)test;
@end

// UILabel+text.m
@implementation UILabel (text)
- (void)test {
  NSLog(@"test");
}
@end

// UIButton+text.h
@interface UIButton (text)
  - (void)test;
@end

// UIButton+text.m
@implementation UIButton (text)
- (void)test {
  NSLog(@"test");// works   
}
@end

// Usage (in UIViewController class) - both elements are defined in XIB
[self.button test];// works
[self.label test];// exception
任何帮助将不胜感激。 我不知道可能出现的问题...... 谢谢。 迈克尔。     
已邀请:
你在使用静态库吗?如果是这样,请将all_load添加到Other Linker Flags。 你确定“UILabel + text.m”在目标中吗?     

要回复问题请先登录注册