Skip to content

Instantly share code, notes, and snippets.

@KirinDave
Created January 27, 2009 22:32
Show Gist options
  • Select an option

  • Save KirinDave/53613 to your computer and use it in GitHub Desktop.

Select an option

Save KirinDave/53613 to your computer and use it in GitHub Desktop.
id pickRandom(NSArray *arr) {
uint length = [arr count];
return [arr objectAtIndex:random() % length];
}
-(void) changeGreeting:(id)sender {
myLabel.font = [UIFont fontWithName:pickRandom([UIFont fontNamesForFamilyName:pickRandom([UIFont familyNames])]) size:36.0f];
myLabel.text = pickRandom(answers);//[answers objectAtIndex:random() % [answers count]];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment