• 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
Creating additional windows in an NSDocument arch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Creating additional windows in an NSDocument arch


  • Subject: Creating additional windows in an NSDocument arch
  • From: Steve Palmer <email@hidden>
  • Date: Mon, 15 Mar 2004 22:01:46 -0800

So I now have an NSDocument based main window. I want to create
additional windows from a different NIB file and there may be 1..N
instances of the second window which can appear at any one time, and
these need to appear under the Window menu so the user can switch
between them. So I created a Window in a new NIB and gave it attributes
as required to ensure that it would qualify for showing up in the
Window menu.

From what I can see, I need to use a NSWindowController subclass,
create it with alloc and showWindow, and initWithWindowNibName in the
init function. Unfortunately the window doesn't show up. No error in
the console log and the init function is being called without any
problems.

What could I be missing? I assumed that a very basic skeleton
implementation as below would at least make the window visible.

...
ReplyWindow * commentWindow = [[ReplyWindow alloc] init];
[commentWindow showWindow:self];
...

@interface ReplyWindow : NSWindowController {
IBOutlet NSTextView * textView;
}
@end

@implementation ReplyWindow

-(id)init
{
self = [super initWithWindowNibName:@"Comment"];
return self;
}

@end
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Creating additional windows in an NSDocument arch
      • From: Amul Goswamy <email@hidden>
  • Prev by Date: Re: Binding to an ImageView and EXC_BAD_ACCESS
  • Next by Date: Re: Safely terminating a thread, or the dealloc that doesn't dealloc?
  • Previous by thread: Re: Binding to an ImageView and EXC_BAD_ACCESS
  • Next by thread: Re: Creating additional windows in an NSDocument arch
  • Index(es):
    • Date
    • Thread