开发者

How to limit the result count of NSFetchRequest?

开发者 https://www.devze.com 2023-02-10 18:15 出处:网络
I want to have a feature of \"Recent 20 Items\" in my iOS app. I us开发者_StackOverflow中文版e Core Data and NSFetchRequest. How can I limit the result number to 20 to achieve this? Thank you in advan

I want to have a feature of "Recent 20 Items" in my iOS app. I us开发者_StackOverflow中文版e Core Data and NSFetchRequest. How can I limit the result number to 20 to achieve this? Thank you in advance!

Kai.


set the fetchLimit of the NSFetchRequest

[request setFetchLimit:20];


Swift 3.0 uses:

request.fetchLimit = 20
0

精彩评论

暂无评论...
验证码 换一张
取 消