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: Andy Lee <email@hidden>
- Date: Sun, 5 Mar 2006 17:30:56 -0500
On Mar 5, 2006, at 4: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.
(When I print out the type of [self cell], it is NSButtonCell.) I see
that +cellClass is being called, but my custom cell class'
getNextValue is
never called.
This was exactly the root of my frustration; it seems that overriding
+cellClass should do the trick and it doesn't. Even the docs
allude to
this. As I mentioned, 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.
Interesting theory. As a workaround, what about sending -setCell: to
your custom button in its init methods? Or have you tried this
already? (I haven't been following the thread closely.)
--Andy
_______________________________________________
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