• 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: may not respond to '-addSubView:'...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >may not respond to '-addSubView:'... (From: patrick <email@hidden>)

  • Prev by Date: Re: may not respond to '-addSubView:'...
  • Next by Date: Re: dumb NSLog question
  • Previous by thread: Re: may not respond to '-addSubView:'...
  • Next by thread: Re: may not respond to '-addSubView:'...
  • Index(es):
    • Date
    • Thread