我认为这对你有帮助
NSArray *namesArray = @[@"anju",@"chandu",@"basha",@"chitra",@"amith",@"baskar"];
NSMutableArray *aArray = [[NSMutableArray alloc]init];
NSMutableArray *bArray = [[NSMutableArray alloc]init];
NSMutableArray *cArray = [[NSMutableArray alloc]init];
for (int j=0; jNSString *string = [namesArray objectAtIndex:j];
if ([string hasPrefix:@"a"]) {
[aArray addObject:string];
}else if([string hasPrefix:@"b"]){
[bArray addObject:string];
}else if([string hasPrefix:@"c"]){
[cArray addObject:string];
}
}
NSLog(@"---%@----%@----%@",aArray,bArray,cArray);