• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Subclassing NSTableView and NSOutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Newbie Question: Building an application for multiple machines
  • Next by Date: Subview updates
  • Previous by thread: Re: PostgreSQL and Objective-C
  • Next by thread: Subview updates
  • Index(es):
    • Date
    • Thread