Re: Best place to set custom NSButtonCell?
Re: Best place to set custom NSButtonCell?
- Subject: Re: Best place to set custom NSButtonCell?
- From: Camillo Lugaresi <email@hidden>
- Date: Wed, 28 Dec 2005 16:26:59 +0100
On 28/dic/05, at 16:13, August Trometer wrote:
As far as I can tell, NSButton doesn't respond to init.
It _does_ respond to initWithCoder:, but setCellClass is a class
method and won't work inside initWithCoder:. Same for awakeFromNib.
Oops, I didn't even notice that setCellClass is a class method...
sorry. But the documentation has this to say about setCellClass:
Discussion
If you have a custom cell subclass that you would like to substitute
for the class of a cell object in a nib file, you should set the cell
class in awakeFromNib (NSNibAwaking protocol). You cannot change the
class programmatically after the cell object has been unarchived from
the nib and instantiated, which occurs immediately after awakeFromNib
returns. If you are going to be using your custom cell frequently,
consider creating your own Interface Builder palette containing the
cell.
So it seems that calling it from awakeFromNib is supposed to work.
Camillo
_______________________________________________
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