自定义Model

作者: 怎一个嫂子了得 | 来源:发表于2017-01-17 09:48 被阅读26次

@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

相关文章

网友评论

    本文标题:自定义Model

    本文链接:https://www.haomeiwen.com/subject/hhlmbttx.html