CPL's iOS Resources
iOS code snippets & other daily musings
Try the search, it's linked to some great forums
Tuesday, June 28, 2011
random method
A simple random number generator method
- (float)randomNumber // -1.000 to +1.000
{
int y = (random() % 2000) - 1000;
float randomNumber = y / 1000.0;
return randomNumber;
}
Newer Post
Older Post
Home