> On 2017 Jun 29, at 23:37, Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> You would get an error trying to declare the override if it did not have the 
> correct method signature.

Yes, of course.  To be honest, most of the time, I don't really *write* Swift.  
I throw some characters onto the screen and click “Fix” :))

> In what class are you doing the “presentError” invocation?

In my NSDocument subclass.

Anyhow, after retrying this morning, I found that it works as expected.  I 
think I was fooled by the fact that, in the Xcode template document-based Cocoa 
app, clicking File > Duplicate gives a different behavior (it opens a new 
document in a new window, a "real Duplicate") than typing its displayed 
keyboard shortcut ⌘⇧S (it prompts a new file path on the frontmost document, an 
old-fashioned “Save As").  It works the same in Apple’s TextEdit.app, but I’d 
never noticed this.

Well, it turns out that only the “real duplicate” operation invokes 
-willPresentError: when user attempts to overwrite an existing document.  
Weird, but a distraction from my present purpose.  Maybe a topic for a future 
thread.

As always, if Quincey Morris doesn’t know the answer, my question was malformed 
:)

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to