-(NSMutableArray*)getRandomArrFrome:(NSArray*)arr { NSMutableArray *newArr = [NSMutableArray new]; while (newArr.count != arr.count) { //生成随机数 int x =arc4random() % arr.count; id obj = arr[x]; if (![newArr containsObject:obj]) { [newArr addObject:obj]; } } return newArr; }
NSArray+YYAdd 这个shuffle方法不知道行不行
/**
Sort the object in this array randomly.
*/
- (void)shuffle;