开发者

iPhone - Cache name for NSFetchedResultsController

开发者 https://www.devze.com 2023-01-27 11:40 出处:网络
G\'day Folks My CoreData driven app has a number of views of data from the same store & all using an NSFetchedResultsController. Currently they开发者_运维问答 all have the same name for the NSFet

G'day Folks

My CoreData driven app has a number of views of data from the same store & all using an NSFetchedResultsController. Currently they开发者_运维问答 all have the same name for the NSFetchedResultsController cache, "Root". Users of my app can, & probably will, jump indiscriminately between views. Would it be better for user experience if I gave the cache for each NSFetchedResultsController a unique name?

TIA, Pedro :)


Providing a different cache name for different fetches is advisable and will help with performance.

From Apple documentation at http://developer.apple.com/library/ios/documentation/CoreData/Reference/NSFetchedResultsController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40008227-CH1-SW24

If you have multiple fetched results controllers with different configurations (different sort descriptors and so on), you must give each a different cache name.

Cheers, Rog

0

精彩评论

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

关注公众号