views:

83

answers:

2

I'd like to have a view that looks more or less like the message list in Tweetie (see screenshot) (no, it's not going to be a Twitter client, though it's similar ;). I'm not sure what Cocoa views should I use for that... I've mostly written stuff for the iPhone recently, and there's only one such control there (UITableView), but in AppKit there's several of them. Should I use NSTableView, or NSCollectionView, or is something else more suitable here?

+5  A: 

NSTableView is the beat fit for a general vertical list. Tweetie looks like it might just be using something custom, though. None of the standard Cocoa classes look much like that.

Chuck
It's probably an NSTableView with custom views for cells, no? All of the behavior is TableView-ish.
Brock Batsell
That's one possibility. Another is that he reimplemented the tiny subset of NSTableView behavior he needed. I've seen both techniques.
Chuck
+1  A: 

Ok, I'll answer myself: according to this blog post, I could use NSTableView, but it's not a very good idea...:

For Mac, you have NSTableView, an antiquated slug of a component that uses NSCell objects instead of NSViews for various historical and performance-related reasons. NSCells are difficult to customize and cannot contain NSView objects (without jumping through hoops and introducing unnecessary complexity) which are the lifeblood of an interactive, engaging interface. Clickable hyperlinks inside of a span of text inside an NSCell? Good luck! Hover effects and Core Animation slickness? Yeah right! NSCell is like a mirage: it looks nice from afar but once you get up close and personal with it you wish you never saw it to begin with.

I think every native Twitter application for the Mac currently does something different for their timeline. Loren Brichter essentially wrote a UITableView port in order to make Tweetie's timeline and Steven Degutis has recently been working on an NSCollectionView-based timeline for his Twitter app. The new Echofon beta timeline is something different entirely with a completely custom text and layout manager that allows for hover effects on links as if it were a WebView. As for Beak I won't be getting into specifics in this entry but I'll just say that it's a totally custom NSScrollView with some fancy caching in the background.

I think I'll try to find some kind of custom open source control made specifically for that purpose... I'm considering AMCollectionView from http://www.harmless.de/cocoa-code.php and SDListView from http://github.com/sdegutis/SDListView.

--

Update: I'm going with SDListView - it's newer, seems to be maintained (it's a part of Steven Degutis's "TheGist" Twitter client), and the version used in that client looks almost identical to the one in Tweetie, which I kind of wanted to rip off anyway...

Psionides