在 OSX 上创建连接到 Core Data 的类似 iTunes 的网格视图
我是一位经验丰富的 iOS 开发人员,对创建 Mac 应用程序感兴趣。我想创建一个通过绑定连接到我的核心数据存储的数据网格视图,它与 iTunes 一样,默认情况下只显示总数据列的子集,但允许用户选择从数据库添加更多列到OSX 有许多类似网格的 GUI 元素,例如 NSTableView、NSOutlineView、NSCollectionView 等。其中哪一个最适合创建这样的视图?
I am an experienced iOS developer interested in creating a Mac application. I want to create a grid view of data connected to my Core Data store via bindings, which, like iTunes, should by default only display a subset of the total data columns, but allow the user to choose to add more columns from the database to be displayed, move them around, etc. OSX has a number of grid-like GUI elements, e.g. NSTableView, NSOutlineView, NSCollectionView, etc. Which of these is the best to create such a view?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
NSCollectionView 项无法处理大量数据,因为它会加载所有视图,即使它们目前不可见。如果您使用超过 500 个元素(或更多),您将在控制台中看到不可用的视图和大量错误。
您应该始终首选 IKImageBrowserView 来显示大量数据,包含在 Quartz 框架中。我认为 iTunes 使用了这个。
The NSCollectionView item cannot handle large amount of data, since it does load all the views even though they're not visible at the moment. If you use for more than 500 elements (or a few more), you will get an unusable view and a lot of errors in the Console.
You should always prefer the IKImageBrowserView for displaying large amounts of data, that is included in the Quartz framework. I think that iTunes uses this.
我不知道 NSCollectionView,它是相当新的,我相信你可以用 NSTableView 做出你想要的东西。它确实与您实现的单元和跟踪控制单元有更多关系。如果这不是您想要的,请查看核心数据应用程序演示可以按照 @sudo rm -rf 到:
NSCollectionView 编程指南
I don't know about the NSCollectionView, it is pretty new, I am sure you can make exactly what you want with an NSTableView. It really has more to do with the cells that you implement and keeping track of your control Cells. Check out the core data application demo, if that isn't what you want you can follow @sudo rm -rf to:
the NSCollectionView programing guide