How do you insert separators in something like an NSTableView?
I'd like to learn how to use some kind of collection separator, such as in this example from Interface Builder:
开发者_Go百科I haven't seen anything about these online, but I don't think I'm searching with the right keywords. Can someone point me in a direction?
Your example from Interface Builder is actually no real separator, it's just a custom NSCell.
Real separators, like available on the iPhone, always stay on top until the whole subgroup has been scrolled through. I hope you understand what i mean :)
To accomplish this, just create a custom cell. Make the cell look like this 'separator' and insert it at the appropriate index.
This might help understanding custom cells:
http://www.martinkahr.com/2007/05/04/nscell-image-and-text-sample/
A great example is Paul Kim's NoodleStickyRowTableView
, now part of NoodleKit. This in addition gives you the iPhone-like behavior of the separator "sticking" at the top of the table.
精彩评论