开发者

CoreData and many NSArrayController

开发者 https://www.devze.com 2022-12-29 06:35 出处:网络
In my CoreData Application, I\'ve an outline view on left of main window, acting as source list (like iTunes); on the right I display a proper view, based on outline selection.

In my CoreData Application, I've an outline view on left of main window, acting as source list (like iTunes); on the right I display a proper view, based on outline selection. Each view has i开发者_高级运维ts components, such as table view, connected to array controller, owned by the specific view. Very often different views display same data, for example, a table view of the same entity.

From a performance point of view, is better to have a single array controller per entity and share it between all views or does CoreData cache avoid memory waste?


Core Data is very efficient, and the array controllers are very efficient and lightweight objects. You should use as many array controllers as necessary. Array controllers maintain selections, so if each outline view can have different selections, you will absolutely need an array controller per each unique selection.

0

精彩评论

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