Re: overriding the initialiser of a NSTextfield subclass
Re: overriding the initialiser of a NSTextfield subclass
- Subject: Re: overriding the initialiser of a NSTextfield subclass
- From: Michael Gersten <email@hidden>
- Date: Thu, 18 Jul 2002 01:45:46 -0700
If you are creating your window in your code, this will work -- initWithFrame: will be called at run time.
But if your window is created in your nib, then IB has sent the initWithFrame: at window creation time (nibs are real freeze-dried objects, not just "here's how to recreate the object").
In that case, you need to override awakeFromNib instead.
Graeme Nattress wrote:
>
I want to override the initialiser of a subclass of NSTextfield, so I
>
can put some initial text in there, and set it up for recieving a
>
drag. This is what I've tried:
>
>
#import "RibPathField.h"
>
>
@implementation RibPathField
>
- initWithFrame:(NSRect)frame
>
{
>
[super initWithFrame:frame];
>
>
[self registerForDraggedTypes:
>
[NSArray arrayWithObject:NSStringPboardType]];
>
>
[self setObjectValue:@"Drop file here"];
>
NSLog(@"here");
>
return self;
>
}
>
@end
>
>
But it doesn't even seem to execute that code. Can anyone help?
>
>
Graeme
>
--
>
--
>
Graeme Nattress: Vice President R&D www.noitaminanimation.com
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
--
I am a Mac OS X-Cocoa/WOF/EOF developer, and I'm available for hire. Please contact me at michael-job @ stb.nccom.com if interested. Resume at
http://resumes.dice.com/keybounce
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.