Random

iPhone SDK Tips & Tricks

int lastNumber;
int rNumber;
while(rNumber == lastNumber)
rNumber = arc4random()%10;
lastNumber = rNumber;