• 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: Instantiating NSCells in Interface Builder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Instantiating NSCells in Interface Builder


  • Subject: Re: Instantiating NSCells in Interface Builder
  • From: Daniel Zitter <email@hidden>
  • Date: Thu, 5 Jun 2003 07:43:29 -0700

Subject: Re: Instantiating NSCells in Interface Builder
From: Pete Yandell <email@hidden>
To: email@hidden

On Thursday, June 5, 2003, at 08:35 AM, Chris Hanson wrote:

On Wednesday, June 4, 2003, at 10:16 AM, Daniel Zitter wrote:
Since cells aren't particularly useful without their associated
controls, directly instantiating a cell isn't the way to go in
Interface Builder. (This must be documented somewhere, but I cannot
find it at the moment.)

Cells can be quite useful without associated controls. For instance,
it would be very useful and clean to be able to instantiate a cell in
Interface Builder, set its properties, and then set it as the data
cell for an NSTableColumn or NSBrowser. This would remove the need to
instantiate the cell in code in the controller's -awakeFromNib and set
it up by hand there.

Yep, that's exactly what I was trying to do: set an NSButtonCell as the
cell for an NSTableColumn.

Pete Yandell

Oh, you want to customize a table column.

There is a workaround which may help you do this directly in IB. (I'll leave it to you to decide if it is worth it to use this workaround or instead just configure the table column in code.)

Add a standalone view to your nib. This is just a vehicle for what follows and will not be seen by the user or used by your code.
Drag a button to this view. Option-drag the button to make it a matrix with multiple button cells. Option-drag the matrix to make it a matrix with a single button cell. Select the button cell and configure as you desire.
Drag a connection from the table column to the button cell and set it as the table column's data cell.


Cheers,
Dan
_______________________________________________
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.

  • Prev by Date: Re: Instantiating NSCells in Interface Builder
  • Next by Date: Re: semantics of init -> Question
  • Previous by thread: Re: Instantiating NSCells in Interface Builder
  • Next by thread: simplified print dialog
  • Index(es):
    • Date
    • Thread