Objective-C Avoid repeating random number
May 25, 2009 § 5 Comments
arc4random() is designed for cryptographic cases. If you use random(), then you would have to seed it with current time. It is random generator.
If you do not want the random number to repeat, use a condition to trigger the random().
While (rNumber == lastNumber)
rNumber = arc4random() % 10;
lastNumber = rNumber;