How to limit the result count of NSFetchRequest?
10,988
Solution 1
set the fetchLimit of the NSFetchRequest
[request setFetchLimit:20];
Solution 2
Swift 3.0 uses:
request.fetchLimit = 20
Author by
nonamelive
Updated on June 07, 2022Comments
-
nonamelive almost 2 years
I want to have a feature of "Recent 20 Items" in my iOS app. I use Core Data and
NSFetchRequest
. How can I limit the result number to 20 to achieve this? Thank you in advance!Kai.