• 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
Overiding NSButton initWithFrame: (doesn't work)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Overiding NSButton initWithFrame: (doesn't work)


  • Subject: Overiding NSButton initWithFrame: (doesn't work)
  • From: Darrin Filer <email@hidden>
  • Date: Fri, 1 Feb 2002 15:40:34 -0500

I've subclassed NSButton but can't get its custom init routine to fire. The apple docs instruct us to:
"Override the designated initializer (NSView's initWithFrame: method) if you create a subclass of NSButton that performs its own initialization."

The buttons draw themselves onto the screen as defined in the nib file. However, the debugger never reaches the breakpoint on the first line of the initWithFrame method... Any ideas?

Here's the code from my interface and implementation files.

===============================================
/* DFFooterButton */
#import <Cocoa/Cocoa.h>
@interface DFFooterButton : NSButton
{
NSImage *image;
NSImage *sourceImage;
NSRect leftSourceRect;
NSRect middleSourceRect;
NSRect rightSourceRect;
}
- (void)redrawImage;
- (id)initWithFrame:(NSRect)frameRect;
@end
===============================================
#import "DFFooterButton.h"
@implementation DFFooterButton
- (id)initWithFrame:(NSRect)frameRect
{
BREAKPOINT HERE IS NEVER REACHED
self = [super initWithFrame:frameRect];
if (self)
{
...
===============================================


  • Follow-Ups:
    • Re: Overiding NSButton initWithFrame: (doesn't work)
      • From: "Erik M. Buck" <email@hidden>
    • Re: Overiding NSButton initWithFrame: (doesn't work)
      • From: Nathan Day <email@hidden>
References: 
 >Re: ProgressIndicator: Chasing Arrow missing in cocoa? (From: Mike Davis <email@hidden>)

  • Prev by Date: Re: [OT] Re: optimizing compilers
  • Next by Date: Re: reading in text files
  • Previous by thread: Re: ProgressIndicator: Chasing Arrow missing in cocoa?
  • Next by thread: Re: Overiding NSButton initWithFrame: (doesn't work)
  • Index(es):
    • Date
    • Thread