I want to develop an app that gives a random quote every time you change the page. And I want to put like 1000 quotes in the database. How is the best way I can get a Random Quote? arc4random?
views:
56answers:
1
A:
To extend the answer you were given on selecting a method to generate a random number - choose a random number method, and have an index for each quote in the DB so that you can query a quote directly from the random number you compute.
Also you can get counts directly from Core Data (without doing a real query) to figure out the range of random numbers you want to ask for.
Kendall Helmstetter Gelner
2010-07-18 19:45:34