1.介绍
- MJExtension为目前非常流行的数据转模型和模型转数据的第三方框架
2.基本使用
- (NSArray *)tgs
{
if (!_tgs) {
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"tgs.plist" ofType:nil];
NSArray *dictTgs = [NSArray arrayWithContentsOfFile:filePath];
NSMutableArray *arrayM = [NSMutableArray arrayWithCapacity:dictTgs.count];
for (NSDictionary *dict in dictTgs) {
XMGTg *tg = [XMGTg tgWithDict:dict];
[arrayM addObject:tg];
}
_tgs = [arrayM copy];
}
return _tgs;
}
- (NSArray *)tgs
{
if (!_tgs) {
_tgs = [XMGTg objectArrayWithFilename:@"tgs.plist"];
}
return _tgs;
}
- (NSArray *)tgs{
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"tgs.plist" ofType:nil];
_tgs = [XMGTg objectArrayWithFile:filePath];
return _tgs;
}
- (NSArray *)tgs{
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"tgs.plist" ofType:nil];
NSArray *dictTgs = [NSArray arrayWithContentsOfFile:filePath];
_tgs = [XMGTg objectArrayWithKeyValuesArray:dictTgs];
return _tgs;
}