Hello Claude3:You asked: But, why not fetch all results and then do the random pick ?That is actually what I am doing. However after I have the results, I must pick a random item from that results. The problem is I don't have a sequential index for any of the columns from which to construct the predicate:selector = Int.random(in: 0 ..< x) fetchRequest.predicate = NSPredicate(format: ??? == %@, selector) // ??? should be a column with a set of numbers between 0...<x.
Topic:
Programming Languages
SubTopic:
Swift
Tags: