NSArray* arr = @[@"1",@"2",@"3"]; arr = [arr sortedArrayUsingComparator:^NSComparisonResult(NSString *str1, NSString *str2) { int seed = arc4random_uniform(2); if (seed) { return [str1 compare:str2]; } else { return [str2 compare:str1]; }
2022-10-17 14:25:40
NSArray* arr = @[@"1",@"2",@"3"]; arr = [arr sortedArrayUsingComparator:^NSComparisonResult(NSString *str1, NSString *str2) { int seed = arc4random_uniform(2); if (seed) { return [str1 compare:str2]; } else { return [str2 compare:str1]; }