Re: Problem with beinSheet, endSheet
Re: Problem with beinSheet, endSheet
- Subject: Re: Problem with beinSheet, endSheet
- From: Markus Hitter <email@hidden>
- Date: Mon, 16 Jul 2001 20:47:35 +0200
Am Montag, 16. Juli 2001 um 17:47 schrieb j o a r:
[...]
=========================================================
- (IBAction)defaultOKButton:(id)sender
{
{
[[sender window] orderOut:nil];
[NSApp endSheet:[sender window] returnCode:NSAlertDefaultReturn];
}
}
=========================================================
And in my "didEndSelector:" I call a method that opens the second sheet.
In other words, you open a sheet recursively. In the didEndSelector the
sheet isn't yet released as it currently calls the selector.
The right thing to do is to queue the next action method in your run
loop with:
[[NSRunLoop currentRunLoop] performSelector:@selector(yourNextSheet)
target:self argument:nil order:0
modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]];
yourNextSheet will be called by the RunLoop shortly after your old sheet
was dismissed.
Hope that helps,
Markus
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/