• 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: Subclassing NSButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subclassing NSButton


  • Subject: Re: Subclassing NSButton
  • From: Ryan Stevens <email@hidden>
  • Date: Fri, 4 Nov 2005 15:01:43 -0800


On Nov 4, 2005, at 2:18 PM, Ricky Sharp wrote:


On Nov 4, 2005, at 1:22 PM, Simon Brée wrote:


Hi everyone,

I'm trying to subclassing NSButton. For the moment, it is just a test : my class SBButton has no specific methods.

In IB, I created a SBButton class ans assigned it to a NSButton.

But when I run my test program, I've got :

[Session started at 2005-11-04 20:13:10 +0100.]
2005-11-04 20:13:11.088 ShapedButton[2868] *** -[SBBouton initWithCoder:]: selector not recognized [self = 0x306810]
2005-11-04 20:13:11.089 ShapedButton[2868] An uncaught exception was raised
2005-11-04 20:13:11.113 ShapedButton[2868] *** -[SBBouton initWithCoder:]: selector not recognized [self = 0x306810]
2005-11-04 20:13:11.113 ShapedButton[2868] *** Uncaught exception: <NSInvalidArgumentException> *** -[SBBouton initWithCoder:]: selector not recognized [self = 0x306810]


ShapedButton has exited due to signal 5 (SIGTRAP).

What did I done wrong ? What does it mean ?


How did you create an instance of your button? Did you use Interface Builder and create a custom view? Or are you building the instance programatically?


It looks like you're creating the button from a nib (and thus initWithCoder is being called).

What exactly is the source to your subclass?


How it's instantiated shouldn't matter, should it? Assuming it's really a subclass of NSButton (and not NSObject or something) initWithCoder should be there.


I'd be most interested in the header. _______________________________________________
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


  • Follow-Ups:
    • Re: Subclassing NSButton
      • From: Ricky Sharp <email@hidden>
References: 
 >Subclassing NSButton (From: Simon Brée <email@hidden>)
 >Re: Subclassing NSButton (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: Subclassing NSButton
  • Next by Date: Re: Subclassing NSButton
  • Previous by thread: Re: Subclassing NSButton
  • Next by thread: Re: Subclassing NSButton
  • Index(es):
    • Date
    • Thread