RE: Return values of NSAlert

2014-10-22 Thread Lee Ann Rucker
Even the old selector-based one could return NSModalResponse values - I saw it happen once in some over-paranoid code that had a switch for the resultCode and an assert in the default case. Surprise, it wasn't handling Abort. NSSavePanel doc shows it as just -

Re: Return values of NSAlert

2014-10-21 Thread Marco S Hyman
The suggested alternative is NSAlertFirstButtonReturn, etc., which have values, which very much unlike the actual returned values. Those values worked for me found by trial an error because the documentation and headers made no sense at all. I was working in swift and found this code to

Re: Return values of NSAlert

2014-10-21 Thread Ken Thomases
On Oct 21, 2014, at 10:59 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: NSAlert has: - (void)beginSheetModalForWindow:(NSWindow *)sheetWindow completionHandler:(void (^)(NSModalResponse returnCode))handler NSModalResponse has three values: Stop, Abort, Continue - none of