在数据模型中 设置一个方法 传入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;
}
本文标题:从NSDictionary中获取数据
本文链接:https://www.haomeiwen.com/subject/ytkzrttx.html
网友评论