取值范围:
[0 , x - 1]
NSInteger random = arc4random_uniform(x);
[1 , x]
NSInteger random = arc4random_uniform(x) + 1;
0 或 1
NSInteger random = arc4random_uniform(2);
取值范围:
[0 , x - 1]
NSInteger random = arc4random_uniform(x);
[1 , x]
NSInteger random = arc4random_uniform(x) + 1;
0 或 1
NSInteger random = arc4random_uniform(2);