我有一个 PFObject 子类 SomeClass,我向其中添加了一个方法iconImageName
。H
@interface SomeClass : PFObject
@property (nonatomic, strong) NSDictionary * availableAttributes;
@property (nonatomic, strong) NSString * type;
- (NSString *)iconImageName;
@end
.m
@implementation SomeClass
@dynamic availableAttributes;
@dynamic type;
+ (NSString *)parseClassName {
return NSStringFromClass([self class]);
}
- (NSString *)iconImageName {
return [NSString stringWithFormat:@"icon-type-%@", self.type];
}
@end
但打电话后
[object iconImageName]
我明白了
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PFObject iconImageName]: unrecognized selector sent to instance 0x174133b00'
我可以确认该对象确实是 SomeClass
当我使用类方法时也会发生这种情况 +