#import "BaseModel.h"
@implementation BaseModel
-(id)initContentWithDic:(NSDictionary *)dic
{
self = [super init];
if (self) {
[self dicToObject:dic];
}
return self;
}
//建立dic和对象之间的映射
-(NSDictionary *)dicObjectAtt:(NSDictionary *)jsonDic
{
NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithCapacity:jsonDic.count];
for (id key in jsonDic) {
[dic setObject:key forKey:key];
}
return dic;
}
-(SEL)stringToSel:(NSString *)modelKey
{
NSString *first = [[modelKey substringToIndex:1] uppercaseString];
NSString *end = [modelKey substringFromIndex:1];
NSString *methodStr &
BaseModel(数据模型映射关系)
最新推荐文章于 2024-04-08 09:23:32 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)