• 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: "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


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: objectSpecifier for a dictionary?
  • Next by Date: Re: Using a custom NSCell for NSButton created in IB
  • 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