• 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: -[NSWindowController window] fails
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -[NSWindowController window] fails


  • Subject: Re: -[NSWindowController window] fails
  • From: Andy Lee <email@hidden>
  • Date: Fri, 28 Nov 2008 12:50:08 -0800

On Nov 28, 2008, at 10:12 AM, Alexander Shmelev wrote:
- (id) init
{
	if (![super initWithWindowNibName:@"Dialog"])
		return nil;

	[self window];

	// there is a lot of code here

	return self;
}

I haven't been following this thread, but I believe someone pointed out you should assign to self, because [super initWithWindowNibName:@"Dialog"] might return a different object than the receiver. Something like:



if (!(self = [super initWithWindowNibName:@"Dialog"])) return nil;

	[self window];

	// etc.

Might not be relevant to your problem, but it's worth doing correctly.

--Andy

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >-[NSWindowController window] fails (From: Alexander Shmelev <email@hidden>)
 >Re: -[NSWindowController window] fails (From: j o a r <email@hidden>)
 >Re: -[NSWindowController window] fails (From: Alexander Shmelev <email@hidden>)

  • Prev by Date: Re: -[NSWindowController window] fails
  • Next by Date: Re: Main Thread stoppin Background Thread
  • Previous by thread: Re: -[NSWindowController window] fails
  • Next by thread: ... not sure if this is a KVO or a Core Audio problem with my code
  • Index(es):
    • Date
    • Thread