Any idea which Cocoa control to use to display the drill-down table as in attached screenshot? On the left panel is a list of items. When an item is selected, the detail of the item is开发者_运维问答 displayed on the right panel. Is it NSOutlineView or NSBrowser? Thanks!
Screenshot http://s1.proxy03.twitpic.com/photos/large/409079140.png
Link to twitpic page
It's an NSTableView
on the left, and most likely an NSTextView
on the right. The NSTableView
on the left most likely has an NSDateFormatter
set for the cell in the third column, which handles converting an NSDate
object into the NSString
value that's shown.
See Table View Programming Guide for more general info on NSTableView
s. There is also NSOutlineView
, which is a subclass of NSTableView
, for when you need to display a data tree. Implementing a table view is much easier than an outline view or NSBrowser
, so only go with an outline view if you really need to.
NSOutlineView will produce something like the left panel, but is probably overkill judging by your screenshot.
NSBrowser would give you a Finder-style drill down.
I would personally use two views - an NSTableView on the left and an NSTextView on the right.
精彩评论