• 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
Re: [Repost] Subclassing NSTableColumn
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Repost] Subclassing NSTableColumn


  • Subject: Re: [Repost] Subclassing NSTableColumn
  • From: Jonathan Jackel <email@hidden>
  • Date: Sun, 10 Nov 2002 15:30:09 -0500

on 11/9/02 3:51 AM, Ken Tozier at email@hidden wrote:

> I need to create a subclass of NSTableColumn so that it can display
> several different types of data and controls in it's cells but I'm not
> sure how to get the table to use my subclass rather the the default one.

You have to do this programmatically, not in Interface Builder. In
awakeFromNib: you would create an instance of your KTTableColumn, then use
[NSTableView addColumn:] to add your column to your view. Then you might
have to move the columns around (moveColumn:toColumn:) to get them arranged
right.

> Also, I'm not entirely sure exactly how to override data members in an
> opaque Cocoa class. Ideally, I'd like to replace "dataCell" in
> NSTableColumn with an NSArray and cache the three or four different
> button and field types in this array. Would I subclass NSTableColumn,
> add something like a "dataCells" field and override the corresponding
> accessor methods by writing my own versions with the exact same method
> name?

You don't necessarily have to subclass NSTableColumn to do this. You can
use [NSTableColumn setDataCell:] to swap out the cells as necessary.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: [Repost] Subclassing NSTableColumn
      • From: Jonathan Jackel <email@hidden>
    • Re: [Repost] Subclassing NSTableColumn
      • From: Vince DeMarco <email@hidden>
  • Prev by Date: Re: Free calendar widgets?
  • Next by Date: Re: "weak link" framework refs for 10.1 compatibility?
  • Previous by thread: [Repost] Subclassing NSTableColumn
  • Next by thread: Re: [Repost] Subclassing NSTableColumn
  • Index(es):
    • Date
    • Thread