Can't open a sheet on a window twice

Posted by moldov on Stack Overflow See other posts from Stack Overflow or by moldov
Published on 2011-01-12T10:50:45Z Indexed on 2011/01/12 10:53 UTC
Read the original article Hit count: 166

Filed under:
|
|

I'm opening a sheet on a window , the first time the sheet opens correctly, but if I close it, and try to open again it doesn't work, I just get the system alert sound.

- (IBAction) showSpeedSheet:(id)sender
{

 [NSApp beginSheet:addEditPackagePanel
    modalForWindow:[[NSApp delegate] window]
  modalDelegate:nil
    didEndSelector:nil
    contextInfo:nil];

}

-(IBAction)endSpeedSheet:(id)sender
{

 [NSApp endSheet:addEditPackagePanel];
 [addEditPackagePanel orderOut:sender];


}

I can't find what's wrong, the app doesn't print any error on the log.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa