Created
July 24, 2012 16:24
-
-
Save dbaldwin/3171007 to your computer and use it in GitHub Desktop.
iOS gist for randomly getting a value from a static array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSArray *upcs = [NSArray arrayWithObjects:@"018208254682", @"885909459865", @"885909480982", @"989898293469", @"725882475691", @"9780060766863", @"9780066620992", nil]; | |
NSString *upc = [upcs objectAtIndex:random()%[upcs count]]; | |
[product setValue: upc forKey: @"upc"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment