Re: Subclassing NSSearchFieldCell
Re: Subclassing NSSearchFieldCell
- Subject: Re: Subclassing NSSearchFieldCell
- From: Stefan Fisk <email@hidden>
- Date: Wed, 2 Nov 2005 19:51:41 +0100
+initialize is called before -awakeFromNib, so it doesn't help. What
i have found out is that it's the coder that gets passed to -
initWithCoder: that creates a NSSearchFieldCell instead of my
AnimatedSearchFieldCell.
This kind of makes sense after reading the docs. My class is being
initialized with a encoded NSSearchField, so naturally it will get a
NSSearchFieldCell. But if this is the way it's supposed to work, then
why does the docs speak of calling +setCellClass: in -awakeFromNib?
And why is the class returned by +cellClass being ignored?
For the moment I'm solving the problem by letting
AnimatedSearchFieldCell pose as NSSearchFieldCell.
AnimatedSearchFieldCell only adds a binding anyway, so it shouldn't
do any harm.
2 nov 2005 kl. 19.18 skrev Hamish Allan:
On 2 Nov 2005, at 18:02, Stefan Fisk wrote:
Is it legal to call the super class's +initialize?
Oh. Apparently not. Thanks!
Anyways, I've tried +setCellClass: both from AnimatedSearchField's
+initialize, and from the window controllers, and on both
AnimatedSearchField and NSSearchField. AnimatedSearchField's
+allocWithZone: is being called, as is +cellClass, so why on earth
it insists on using NSSearchFieldCell is above and beyond my
comprehension.
How about calling +setCellClass: from -[AnimatedSearchField's
awakeFromNib]?
Cheers,
Hamish
_______________________________________________
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