在数据模型中 设置一个方法 传入NSDictionary 中
-(instancetype)initWithDic:(NSDictionary*)dic{
self= [super init];
if(self) {
[self setValuesForKeysWithDictionary:dic];
}
return self;
}
复制代码
在数据模型中 设置一个方法 传入NSDictionary 中
-(instancetype)initWithDic:(NSDictionary*)dic{
self= [super init];
if(self) {
[self setValuesForKeysWithDictionary:dic];
}
return self;
}
复制代码
转载于:https://juejin.im/post/5a31005c6fb9a045211eb483