字典数组里包含字典数组怎么用mjextecsion
1个回答
2016-06-05
展开全部
- (NSArray *)citySections
{
if (_citySections == nil) {
NSString *path = [[NSBundle mainBundle] pathForResource:@"Cities.plist" ofType:nil];
NSArray *dataArray = [NSArray arrayWithContentsOfFile:path];
NSMutableArray *arrayM = [NSMutableArray arrayWithCapacity:dataArray.count];
for (NSDictionary *dict in dataArray) {
// MJExtension框架里,字典转模型的方法
CitySection *section = [CitySection objectWithKeyValues:dict];
[arrayM addObject:section];
}
_citySections = arrayM;
}
return _citySections;
}
{
if (_citySections == nil) {
NSString *path = [[NSBundle mainBundle] pathForResource:@"Cities.plist" ofType:nil];
NSArray *dataArray = [NSArray arrayWithContentsOfFile:path];
NSMutableArray *arrayM = [NSMutableArray arrayWithCapacity:dataArray.count];
for (NSDictionary *dict in dataArray) {
// MJExtension框架里,字典转模型的方法
CitySection *section = [CitySection objectWithKeyValues:dict];
[arrayM addObject:section];
}
_citySections = arrayM;
}
return _citySections;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询