Random Number in Cocoa and Objective-c
Generating a random number is fairly simple using arc4random(). Say you want a random integer between 10 (min) and 1000 (max). Here's how to do it:
Also, no need to do any seeding with this method.
int max = 1000; int min = 10; int value = (arc4random() % max) + min;
Also, no need to do any seeding with this method.
Labels: arc4random, random number
