NSCollectionView
是在 OS X 10.5 中引入的,但尚未在 Cocotron 中实现。
我正在尝试实现一个小型应用程序,该应用程序将允许为在线服务创建正确打包的数据文件,然后由管理员上传。更具体地说,用户将通过将输入和输出文件拖到窗口上来创建输入和输出数据对的集合。
目前的想法是,用户拖动一个文件,从文件名中检测它是否是输入或输出文件名(默认情况下为输入),并将带有用于输入和输出的图标和文件名的视图添加到集合视图中。然后,将第二个文件拖放到“其他”图标上。
但是,NSCollectionView
不会出现在 10.5 之前的版本中,而且我的大多数用户都没有 Mac,因此我必须提供一个 Cocotron 构建的应用程序。不仅如此;我仍然没有完全理解 KVC/KVO,我真的应该理解我的代码所做的一切。因此,我需要 NSCollectionView 的替代方案。
除了使用 NSCollectionView
之外,我还有什么选择?(任何直观的解决方案都值得赞赏,不要觉得受到上述我的想法的描述的限制。)
NSCollectionView
was introduced in OS X 10.5, and is not yet implemented in Cocotron.
I am trying to implement a small app that will allow creating properly packaged data files for an online service, which will then be uploaded by an administrator. More specifically, the user will create a collection of input and output data pairs, by dragging input and output files onto the window.
Currently the idea is that user drags a file, from the filename it's detected if it's the input or output filename (by default, input), and a view with icon and filename for input and output is added to collection view. Then, the second file is dropped on the "other" icon.
However, NSCollectionView
does not appear in pre-10.5, and most of my users don't have Macs so I'll have to provide a Cocotron-built application. Not only that; I still don't fully understand KVC/KVO, and I really should understand everything that my code does. Hence, I need an alternative to NSCollectionView
.
What alternative do I have to using NSCollectionView
? (Any intuitive solution is appreciated, don't feel limited by the above description of my idea.)
发布评论
评论(2)
要使用 NSCollectionView,您不仅需要了解 KVC 和 KVO,还需要 绑定。
此处提供了适用于 Tiger 的 NSCollectionView 克隆代码。
To work with NSCollectionView, you need to not only understand KVC and KVO, but also Bindings.
There's code for an NSCollectionView clone that works on Tiger here.
这就是文档的用途:
自己做吧。
That's what the docs are for:
Make your own.