• 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: Using a custom NSCell for NSButton created in IB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Using a custom NSCell for NSButton created in IB (From: "Stephen F. Booth" <email@hidden>)
 >Re: Using a custom NSCell for NSButton created in IB (From: Greg Herlihy <email@hidden>)
 >Re: Using a custom NSCell for NSButton created in IB (From: email@hidden)

  • Prev by Date: Re: problem with subclassing a cluster class
  • Next by Date: Re: GDB: without symbol name?
  • Previous by thread: Re: Using a custom NSCell for NSButton created in IB
  • Next by thread: Re: Using a custom NSCell for NSButton created in IB
  • Index(es):
    • Date
    • Thread