Re: Dynamically loading NIB files into sheets
Re: Dynamically loading NIB files into sheets
- Subject: Re: Dynamically loading NIB files into sheets
- From: j o a r <email@hidden>
- Date: Tue, 16 Apr 2002 07:30:55 +0200
On Tuesday, April 16, 2002, at 12:47 , Sebastian Celis wrote:
3) the sheet appears but is _not_ attached to the document window. I
think that this has to do with the line in the sheet creation:
This is probably because you don't return from the button action method
before opening the sheet. Try to delay the opening of the sheet a
little, like this:
- (IBAction)openSheet:(id)sender
{
id theSheetController;
int tag = [[thePopUp selectedItem] tag];
NSString *sheetIdentifier = [self sheetIdentifierForTag:tag];
switch(tag)
{
default: // temporarily default until I get the code working
theSheetController = [sheetController
sheetControllerForIdentifier:sheetIdentifier];
}
[self performSelector:@selector(openSheetFromController:)
withObject:theSheetController afterDelay:0.0];
}
- (void) openSheetFromController:(id)sheetController
{
[NSApp beginSheet:[sheetController window]
modalForWindow:myDocumentWindow
modalDelegate: sheetController
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo:nil];
}
j o a r
_______________________________________________
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.