獲取隨機數

[NSTimer scheduledTimerWithTimeInterval:[self getRandomNumber:1 to:8] target:self selector:@selector(handleTimer:) userInfo:nil repeats:YES];dom

//獲取隨機數get

-(int)getRandomNumber:(int)from to:(int)toit

 

{隨機數

    return (int)(from + (arc4random() % (to - from + 1)));select

}im

相關文章
相關標籤/搜索