I have a very simple iPhone app that requires a random integer from 1-100.
I have a button that calls the random number function then displays it.
-(IBAction)buttonReleased;
{
srandom(time(NULL));
int theNum = random() % 100 + 1;
numberDisplay.text = [NSString stringWithFormat:@"%d", theNum];
}
The problem is, if I press the button quickly, sometimes it won't display a new random number.