NSString *path = nil;
path = [[NSBundle mainBundle] pathForResource:@"AreaBBSPlist" ofType:@"plist"];
NSArray *pathArray = [NSArray arrayWithContentsOfFile:path];
for (int i=‘A‘; i<=‘Z‘; i++) {
NSMutableArray *arr = [[NSMutableArray alloc] init];
for (NSDictionary *dict in pathArray) {
if ([[dict objectForKey:@"firstletter"] isEqualToString:[NSString stringWithFormat:@"%c",i]]) {
[arr addObject:dict];
}
}
if (arr.count) {
[_dataArray addObject:arr];
}
[arr release];
}
// Do any additional setup after loading the view.
}
时间: 2024-11-01 20:16:50