Assuming the code that calls the confirm:withMoreInfo:andTheActionButtonTitle:
is called from validate
.
-(void)validate
{
NSAlert *alert = [[NSAlert alloc] init];
[alert setMessageText:questionTitle];
// fill out NSAlert
[alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
if(returnCode == NSModalResponseStop)
{
confirmFlag = YES;
}
else
{
confirmFlag = NO;
}
//Rest of your code goes in here.
}];
}
The rest of your code needs to be INSIDE the completion block.