• 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
sheets in separate nibs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sheets in separate nibs


  • Subject: sheets in separate nibs
  • From: Derrek Leute <email@hidden>
  • Date: Thu, 12 Oct 2006 20:37:02 -0400


do I have to put sheets in separate nibs?

all the examples in the documentation that I've found (NSPersistentDocument Core Data Tutorial and Custom Sheets) put a panel in a separate nib. This seems excessive.

At the same time, I can't seem to use IBOutlet, because my objects are created at runtime due to user interaction. At least, even though the Outlet is connected, it claims that addPanel is nil.

code snippet:

@interface TreeWrapper : NSObject
{
	IBOutlet NSPanel *addPanel;
}

- (void) showAddSheet
{
NSWindow *window = [NSApp mainWindow];
//NSDocument *document = [[NSDocumentController sharedDocumentController] currentDocument];
if (addPanel == nil) {
NSLog(@"nil addpanel");
}
if (window == nil) {
NSLog(@"nil window");
}
[NSApp beginSheet: addPanel modalForWindow: window modalDelegate: self didEndSelector: @selector (didEndAddSheet:returnCode:contextInfo:) contextInfo: nil];
}


This object is created during run time (ultimately from the user clicking a plus button), and running showAddSheet results in:

2006-10-12 16:07:35.420 Conductor[27431] nil addpanel
2006-10-12 16:07:35.466 Conductor[27431] *** Assertion failure in - [NSApplication _commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndS elector:contextInfo:], AppKit.subproj/NSApplication.m:3057
2006-10-12 16:07:35.466 Conductor[27431] *** NSRunLoop ignoring exception 'Modal session requires modal window' that raised during posting of delayed perform with target 3b4590 and selector 'invokeWithTarget:'


Is the only answer to use new nibs for each sheet? or is there another solution so I can keep all my sheets in the main nib?

--Derrek
_______________________________________________
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:
    • Re: sheets in separate nibs
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: Disk insert event
  • Next by Date: Stop NSSplitView from resizing with Window?
  • Previous by thread: Re: Disk insert event
  • Next by thread: Re: sheets in separate nibs
  • Index(es):
    • Date
    • Thread