views:

41

answers:

2

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.

NSCollectionViewItem's view

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.)

A: 

I still don't fully understand KVC/KVO…

That's what the docs are for:

What alternative do I have to using NSCollectionView?

Make your own.

Peter Hosey
Hm. That was... very "useful". "Make your own" is clearly the answer I'm looking for, of course. Thanks, but no thanks. I've developed a UI library before, and for this project I have better things to do, or else I'd use that lib. And not understanding KVC/KVO at the moment is not the primary reason behind asking this question.
Ivan Vučica
+3  A: 

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.

kperryua
Thank you! When I'll go back to this project, I'll check this out and accept the solution.
Ivan Vučica
I decided that it's more intuitive to use NSTableView and sheets than collection view, but I shall nevertheless accept the answer since it looks about right.
Ivan Vučica