How can I limit the size of the retrieved FetchedResults
when making a FetchRequest
to CoreData?
You need to create FetchRequest
with NSFeatchRequest
using corresponding initialiser, as shown below
init() {
let request: NSFetchRequest = Kana.fetchRequest()
request.fetchLimit = 10
request.predicate = NSPredicate(format: "alphabet == %@", "hiragana")
fetchRequest = FetchRequest(fetchRequest: request)
}