@interface BaseModel:NSObject
- (void)setValue:(id)value forUndefinedKey:(NSString *)key;
@interface Mymodel:Basemodel;
@property(nonatomic,copy) NSSting *str;
- (instancetype)initMyModelWithDictionary:(NSDIctionary *)dictonary ;
@implementation MyModel
- (instancetype)initMyModelWithDictionary:(NSDIctionary *)dictonary {
if(self = [super init]){
[self setValuesForKeysWithDictionary:dictionary];
}
return self;
}
@end
网友评论