[NSTimer scheduledTimerWithTimeInterval:[self getRandomNumber:1 to:8] target:self selector:@selector(handleTimer:) userInfo:nil repeats:YES];
//获取随机数
-(int)getRandomNumber:(int)from to:(int)to
{
return (int)(from + (arc4random() % (to - from + 1)));
}
时间: 2024-11-17 02:50:18