Re: may not respond to '-addSubView:'...
Re: may not respond to '-addSubView:'...
- Subject: Re: may not respond to '-addSubView:'...
- From: Joshua Scott Emmons <email@hidden>
- Date: Sun, 8 Jan 2006 23:55:58 -0600
On Jan 8, 2006, at 11:42 PM, patrick wrote:
I'm creating a simple screen saver that will use a custom view class
from another project. I'm trying to add this second view to the screen
saver view with:
@implementation MyScreenSaverView
- (id)initWithFrame:(NSRect)frame
{
// create custom view
myView = [ ... initialize ... ];
[self addSubView:myView];
}
You need to init your superclass (NSView) first:
@implementation MyScreenSaverView
- (id) initWithFrame:(NSRect)frame {
self = [super init];
if (self != nil) {
myView = [ ... initialize ... ];
[self addSubView:myView];
}
return self;
}
Cheers,
-Joshua Emmons
_______________________________________________
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