Subclassing NSTableView and NSOutlineView
Subclassing NSTableView and NSOutlineView
- Subject: Subclassing NSTableView and NSOutlineView
- From: Jonathon Mah <email@hidden>
- Date: Sat, 16 Apr 2005 06:20:09 +0930
Hi all,
I'm writing a subclass of NSTableView that can display a highlight
around certain rows (similar to Address Book, when the option key is
held down). It's very straightforward until it comes to dealing with
highlighted cells. But anyway, back to the main question: I also need
the same functionality of NSOutlineView. At the moment I have my
subclass of NSTableView, then I duplicate the file, change the class
name, and make it inherit from NSOutlineView - apart from that, the
files are identical. Something inside me is screaming out that there
must be a better way, but if there is, it's certainly eluding me.
It could be done as a category on NSTableView, but it'd be a bit messy
because it relies on instance variables and overriding methods. And it
shouldn't be a category, because only some tables need this highlight
functionality.
How can I avoid duplication of this code, different by only one line
(the class name and its superclass)?
Jonathon Mah
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden