如何像“filteredArrayUsingPredicate”一样过滤 NSFetchedResultsController
是否可以在不调用数据库层的情况下过滤 NSFetchedResultsController 的结果,就像我使用带有“filteredArrayUsingPredicate”的 NSArray 所做的那样
谢谢
is it possible, to filter the results of a NSFetchedResultsController without a new call to the databaselayer, like I do it with an NSArray with "filteredArrayUsingPredicate"
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 NSFetchRequest 上设置谓词,用于初始化 NSFetchedResultsController。例如:
您不需要“刷新”获取的结果控制器,因为它应该随着更改和保存而更新。您可能需要使用样板代码来使用和/或更新带有获取结果控制器的表视图。
You can set a predicate on the NSFetchRequest that you use to initialize your NSFetchedResultsController. For example:
You shouldn't need to "refresh" the fetched results controller since it should update as changes are made and saved. You may need to use the boilerplate code for using and/or updating a table view with a fetched results controller.