• 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: Newbie: setting a delegate to NSWindow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie: setting a delegate to NSWindow


  • Subject: Re: Newbie: setting a delegate to NSWindow
  • From: Nick Zitzmann <email@hidden>
  • Date: Wed, 9 Mar 2005 22:59:52 -0700


On Mar 9, 2005, at 8:21 PM, Aaron Vegh wrote:

    - (id)init
{
        [super init];
        theWindow = [[NSWindow alloc]init];
    [theWindow setDelegate:self];
    return self;
}

First of all, you should set self to [super init] and check to make sure that [super init] doesn't return nil.


Second, you need to use NSWindow's designated initializer rather than -init, which in the case of NSWindow is -initWithContentRect:styleMask:backing:defer:. If you use an initializer other than an object's designated initializer, then the object may not work correctly.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________
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: 
 >Newbie: setting a delegate to NSWindow (From: Aaron Vegh <email@hidden>)

  • Prev by Date: Re: Where's the list box?
  • Next by Date: Re: Asymmetrical behavior in NSMutableArray
  • Previous by thread: Newbie: setting a delegate to NSWindow
  • Next by thread: Newbie: setting a delegate to NSWindow
  • Index(es):
    • Date
    • Thread