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]; }
原文地址:https://www.cnblogs.com/shenlaiyaoshi/p/9436662.html
时间: 2024-10-14 19:39:26