Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hazkid

macrumors newbie
Original poster
I would like to implement a Finder/iTunes sidebar for my app. I have an NSOutlineView with a data source and everything, except I can't seem to implement the outlineView:isGroupRow: delegate method. I've tried returning yes for all items, identifying by index, string value, and nothing seems to work. The outline view is in IB with highlight style "source list" (for the active blue/inactive gray background).
The examples on Apple.com (SourceView and DragNDropOutlineView) are so complex I can't navigate through them - they're designed for higher level programmers than me. All of their data is loaded from the system, resulting is tons of code that I simply can't wade through.

I can't believe something like this could be so difficult. There are virtually no examples on the web, either- most of them were written before Leopard, using special backgrounds and gradients for the highlighting.

Thanks in advance to anyone who can lead me in the right direction with this.
 
Make sure you have the outline view's delegate set, since outlineView:isGroupRow: is a delegate method, not a datasource method.

Edit: here's a sample project I whipped up to demonstrate. I tried to keep it as bare minimum as possible.
 

Attachments

Wow. That sample project was incredible. It was simple enough to read! Thank you so much.

I had tried setting the delegate before, but it made my app crash, so I disconnected it, thinking "well, this can't be it".

But everything works great now.
 
Wow. That sample project was incredible. It was simple enough to read! Thank you so much.

I always find it amazing that Apple's examples are so overly complex.

I've always wanted to start a site that hosts very basic sample projects that demo Cocoa features, but just haven't gotten around to it. Maybe soon 😉

But everything works great now.

Great! Glad it's working.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.