1

Background

  • Core Data app on Snow Leopard 10.6.4 with GC

  • I've got an NSOutlineView backed by NSTreeController using bindings

  • I'm creating tens of objects on a background NSOperation subclass, saving and using mergeChangesFromContextDidSaveNotification to merge into the main context, all as recommended in the Apple docs

  • The main context has thousands of objects

The Problem

I've had lots of performance problems. Sometimes a merge can take a few seconds which locks up my UI. It also seems to use rather a lot of memory.

I recently found that others have had this issue too. I'm starting to think this is a restriction of the NSTreeController/NSOutlineView combination with bindings.

Questions

  1. Can NSOutlineView and NSTreeController handle thousands of objects efficiently?

  2. This post seemed to imply that this was an issue on 10.6.2 quoting rdar://7139579. Does anyone know if this has been "fixed"?

I'd greatly appreciate any suggestions.

4

1 回答 1

0

底线?我想我需要以通常的方式优化我的应用程序。此外,有很多 KVO 通知被触发,所以可能显示更少的数据是要走的路。当我加快我的应用程序时,我可能会在这里进一步报告。

更新:2011 年 9 月

自从发布这个问题以来,我学到了很多东西。我的一个重要教训是,有时,你必须放弃你想要的东西,并接受这将是一种设计权衡。

我目前正在重新设计我的应用程序的外观以使其更快。我了解到,NSTreeController 最多只能处理几百个条目。成千上万的条目意味着无论如何用户都会感到困惑。我重新设计了我的 UI,使其更简单。而现在我使用的是表格视图,这要快得多。

于 2010-11-18T13:19:20.770 回答