• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Right views for a N items, each of which can have M items within it?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Right views for a N items, each of which can have M items within it?


  • Subject: Right views for a N items, each of which can have M items within it?
  • From: Brian Marick <email@hidden>
  • Date: Tue, 8 Feb 2011 18:32:00 -0600

I previously had a single-column collection view. Each element corresponded to a file. If you hit space while an element was selected, you'd get the quicklook. If you double-clicked, you'd open the file. So that looked like this:

     Element
     Element
     Element

This was implemented as an NSCollectionView because each element had multiple bits of information to display in its view.

New feature: each element can now correspond to one or more files. The desired appearance expands the single column into what looks like two columns, like this:

-----
Element		File 1
-----
Element		File 1
			File 2
-----
Element		File 1
			File 2
			File 3
			File 4
			File 5

It would be nice if each NSCollectionItemView could be a different height, to accommodate all the files, but NSCollectionView doesn't support this.

My first attempt was to embed an NSTableView in the righthand side of each NSCollectionItemView, and do a little observeValueForKeyPath:ofObject:change:context hackery to notice when the backing NSArrayController changed and attach/reattach the dataSources of the NSTableViews. (At times, the NSArrayController will get a different backing array.) That didn't work because the tables wouldn't update until the user clicked somewhere in the user interface.

I thought of using an NSTextView-with-scrollbar and having each filename be on a new line, but starting down that path makes it seem like a lot of work, as would be some sort of NSMatrix or a custom view.

A user looking at the display will be interested in seeing the filenames for multiple elements, so a master/detail interface would be unsatisfactory.

Anyone have any suggestions for the right element-container and file-within-element-container classes to use?


-----
Brian Marick, Artisanal Labrador
Contract programming in Ruby and Clojure
Author of /Ring/ (forthcoming; sample: http://exampler.com/tmp/ring.pdf)
www.exampler.com, www.exampler.com/blog, www.twitter.com/marick

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Initializing NSError **, again Re: CoreData Migration Problems
  • Next by Date: NSDocument without Save
  • Previous by thread: Re: CoreData Migration Problems
  • Next by thread: NSDocument without Save
  • Index(es):
    • Date
    • Thread