生成0-10的随机数(包含0,不包含10)
(arc4random()
% 10)
1、 获取一个随机整数范围在:[0,100)包括0,不包括100
int x = arc4random() % 100;
int y = (arc4random() % 501) + 500;
-(int)getRandomNumber:(int)from to:(int)to
{
return (int)(from + (arc4random() % (to – from + 1)));
}