[categories] [index] [all (552)] [latest]
Random int between 0 and N
NSUInteger r = arc4random_uniform(N);
Random int between 1 and N
NSUInteger r = arc4random_uniform(N - 1) + 1; // no modulo biais
Random double between 0 and 1
srand48(time(0));
double r = drand48();
Source: http://nshipster.com/random/