标签:
+ (NSArray *)randomColors {
// NSMutableArray *startColors = [NSMutableArray arrayWithObjects:randomColor1,randomColor2,randomColor3,randomColor4,randomColor5,randomColor6,randomColor7,randomColor8,randomColor9,randomColor0,nil];
NSMutableArray *startColors = [NSMutableArray arrayWithObjects:@0,@1,@2,@3,@4,@5,@6,@7,@8,@9,nil];
NSMutableArray *colors = [NSMutableArray arrayWithObjects:@0,@0,@0,@0,@0, nil];
for (int i = 0; i < 5; i++) {
int t = arc4random()%startColors.count;
colors[i] = startColors[t];
startColors[t] = [startColors lastObject];
[startColors removeLastObject];
}
return colors;
}
标签:
原文地址:http://www.cnblogs.com/softlit/p/4431640.html