Hope the below lines of code will help you
srand(time(NULL));
int randomIndex = rand() % limit;
[reportIDTextField setText:[NSString stringWithFormat:@"%i", randomIndex]];
Benefit of this code is it won't allow repetitive random numbers. Here limit for random numbers.
Hope this is what you are looking for.
Enjoy Coding :)