Reputation: 1137
I still have a long way to go learning Cocoa. I'm trying to learn to code a Table view just like the finder where there is a small icon to the left of the file listing. #1 Its not clear to me if those are two columns in a row or if that type of operation is handled as 1 column.
If someone could point me to a good, easy to follow example, I would appreciate it. I was able to follow one example and I can drag and drop files onto the view but it only displays the [files lastPathComponent]. I wasn't sure how to add the icon.
Upvotes: 1
Views: 1152
Reputation: 1814
While yes you could do as sosborn suggests, however if you're already using OSX 10.7 Lion, you can now (and should!) use NSViews instead. And specifically you can subclass NSTableCellView.
Personally, I would watch the WWDC video titled "View Based NSTableView Basic to Advanced" available here: https://developer.apple.com/videos/wwdc/2011/
This also includes sample code that will get you going.
Upvotes: 3
Reputation: 14694
You are going to have to subclass NSCell if you want this. Here is a good example:
Upvotes: 3