NSArray * array = @[@"aZ",@"ZbcAc",@"ZbcAb",@"Zd",@"Zw",@"Zz"];
NSArray * array2 = [array sortedArrayUsingComparator:^NSComparisonResult(NSString * obj1, NSString * obj2) {
return [obj1 compare:obj2 options:NSCaseInsensitiveSearch];
}];
NSLog(@"%@",array2);
输出结果
aZ,
ZbcAc,
ZbcAb,
Zd,
Zw,
Zz