Created
August 5, 2012 23:20
-
-
Save adelevie/3267887 to your computer and use it in GitHub Desktop.
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
count = PFQuery.queryWithClassName("Noun").countObjects | |
query = PFQuery.queryWithClassName("Noun") | |
query.limit = 1 | |
query.skip = rand(count) # for the non-Rubyists, this just finds a random int between 0 and `count` | |
query.findObjects.first |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
is there any "newer" solution? Maybe in Swift? And how do I query for a number > 1 random objects?