iPhone OS: Fetching a random entity instance using NSPredicate Nsfetchrequest and core data
- by nickthedude
Working on an app where I have a large collections of managed objects against which I want to fetch a few random instances.
My question is, is there any way I can use NSPredicate and NSFetchRequest to return several objects at random.
I saw that you could actually add a NSFetchRequest into the entity using the data modeler, any way to do the random fetch using this?
Also what would be the best method for determining the "count" of a table so I can set the bounds of the random number generator.
let me know if you need more details.
Thanks!
Nick