Re: Using a custom NSCell for NSButton created in IB
Re: Using a custom NSCell for NSButton created in IB
- Subject: Re: Using a custom NSCell for NSButton created in IB
- From: "John C. Randolph" <email@hidden>
- Date: Sun, 5 Mar 2006 15:50:13 -0800
On Mar 5, 2006, at 1:30 PM, email@hidden wrote:
I actually tried this before, and it does not work. My NSButton
subclass
for some reason still uses NSButtonCell instead of my custom cell
class.
I have a feeling it is because the button object is
being instantiated using initWithCoder, which sets up the object
using the
archived NSButtonCell instance instead of creating a new one of the
specified type.
Your feeling is correct. You can replace it in -awakeFromNib.
This was exactly the root of my frustration; it seems that overriding
+cellClass should do the trick and it doesn't.
No need to send a +cellClass message unless you're creating a new
instance of the button. Unarchiving isn't quite the same as creating
a new object ex nihilo.
-jcr
John C. Randolph <email@hidden> (408) 914-0013
Roaming Cocoa Engineer,
Available for your projects at great Expense and Inconvenience.
_______________________________________________
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