Hello,
I decided to use an alert sheet with 2 buttons. When the user clicks the continue button a sheet made from a window should come down. The sheet comes down and the parent window closes along with the other sheet. The code I'm using is:
- (void)alertDidEnd:(NSAlert *)alert returnCode:(int)returnCode contextInfo:(int *)contextInfo
{
if (returnCode == kOkayButtonCode) {
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
NSString *status = [defaults objectForKey:@"userStatus"];
if (status == @"NO") {
[NSApp beginSheet:theSheet modalForWindow:window
modalDelegate:self didEndSelector:NULL contextInfo:nil];
}
if (status == @"YES") {
}
}
if (returnCode == kCancelButtonCode) {
[NSApp performSelector:@selector(terminate:) withObject:nil afterDelay:0.45];
}
}
Can anyone see a problem with this?
Thanks for any help