• 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: unused window initializer in document-based cocoa app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unused window initializer in document-based cocoa app


  • Subject: Re: unused window initializer in document-based cocoa app
  • From: Kyle Sluder <email@hidden>
  • Date: Wed, 7 Oct 2009 23:47:48 -0700

On Sun, Oct 4, 2009 at 3:23 AM, Eimantas Vaičiūnas
<email@hidden> wrote:
>- (id)init {
>  self = [super initWithWindowNibName:@"BlankDoc"];
>
>  if (self != nil) {
>    NSRect windowFrame = NSMakeRect(100.0f, 800.0f, 500.0f, 500.0f);
>    self.window = [[BlankWindow alloc] initWithContentRect:windowFrame

You're calling -initWithWindowNibName:, giving it a nib with a window
already in it.  Therefore it is unnecessary to create yet another
window.  Just hook up the existing one in the nib to File's Owner's
window outlet.

> *** -[BlankWindow initWithFrame:]: unrecognized selector sent to instance

NSWindow doesn't have an -initWithFrame: method, so this should be an
immediate indication to you that something is very wrong.  Especially
if you haven't written any code that tries to call -initWithFrame: on
an NSWindow.

This is usually an indication of a memory management bug.  After
fixing your first problem, with NSZombieEnabled to see where your
memory bug is.

--Kyle Sluder
_______________________________________________

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: 
 >unused window initializer in document-based cocoa app (From: Eimantas Vaičiūnas <email@hidden>)

  • Prev by Date: Re: Active Read/Write of NSTask
  • Next by Date: Re: Problems calling a method from an IB-created instance...
  • Previous by thread: unused window initializer in document-based cocoa app
  • Next by thread: Base64 encoding and deprecated stringWithCString: length:
  • Index(es):
    • Date
    • Thread