//打乱顺序
NSArray *tArr = [@"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8"];
tArr = [tArr sortedArrayUsingComparator:^NSComparisonResult(NSString *obj1, NSString *obj2) {
int seed = arc4random_uniform(2);
if (seed) {
return NSOrderedAscending;
} else {
return NSOrderedDescending;
}
}];
网友评论