调用属性valueforkey 方法出现问题:
@interface Value : NSObject
@property(nonatomic,getter = toString,readonly)NSString *stringVal;
-(NSString*) toString;
@end
当我调用[instanceOfValueClass valueForKey:@"stringVal"]
。说键值不兼容。
信息如下:
[ valueForUndefinedKey:]: this class is not key value coding-compliant for the key stringVal