• 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 confusion redux
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWindowController confusion redux


  • Subject: Re: NSWindowController confusion redux
  • From: Ken Tozier <email@hidden>
  • Date: Tue, 23 May 2006 12:17:00 -0400


On May 23, 2006, at 11:46 AM, Sherm Pendley wrote:

You've missed the mark on some of the details, but I think you have the right idea. I think the file's owner is a red herring, and a clue to the problem can be found in that "failed to load window nib file" message. Figuring out why the nib won't load is key to solving this.

Thanks Sherm and Mike. Your suggestions gave me a hint and I finally figured this sucker out.


The nib lives in a rather unusual location and unfortunately I have no control over that (I'm writing a Quark XTension and Quark puts their XTensions outside the application bundle) As a consequence, the normal bundle routines have no idea how to find my nib. I have to explicitly define the path and use [bundle initWithNibFilePath:] and that method doesn't come in a non-owner variety.

Looks a bit odd, but here's what works:

// My code is a plugin and the "bundle" here is supplied by the code that loads me
mainPalettePath = [bundle pathForResource: @"MainPalette" ofType:@"nib"];

// Allocate the controller
mainPaletteController = [NSWindowController alloc];


// Initialize it with itself as owner
mainPaletteController = [mainPaletteController initWithWindowNibPath: mainPalettePath owner: mainPaletteController];


// Bingo! We now have a valid window reference
NSLog(@"window = %@", [mainPaletteController window]);

Thanks guys for your help.

Ken
_______________________________________________
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


  • Follow-Ups:
    • Fwd: NSWindowController confusion redux
      • From: Ken Tozier <email@hidden>
References: 
 >NSWindowController confusion (From: Ken Tozier <email@hidden>)
 >Re: NSWindowController confusion (From: Sherm Pendley <email@hidden>)
 >Re: NSWindowController confusion (From: Ken Tozier <email@hidden>)
 >Re: NSWindowController confusion redux (From: Ken Tozier <email@hidden>)
 >Re: NSWindowController confusion redux (From: mmalcolm crawford <email@hidden>)
 >Re: NSWindowController confusion redux (From: Ken Tozier <email@hidden>)
 >Re: NSWindowController confusion redux (From: Mike Abdullah <email@hidden>)
 >Re: NSWindowController confusion redux (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: Bug in PDFKit's PDFDocument attributes?!
  • Next by Date: Core Data Import
  • Previous by thread: Re: NSWindowController confusion redux
  • Next by thread: Fwd: NSWindowController confusion redux
  • Index(es):
    • Date
    • Thread