NSUInteger r = arc4random_uniform(N);
NSUInteger r = arc4random_uniform(N) + 1;
NSUInteger r = arc4random_uniform(2 * N + 1) - N;
NSUInteger r = arc4random_uniform(N2 - N1 + 1) + N1;
更多的能夠參看這裏dom