Re: didPrint selector not called
Re: didPrint selector not called
- Subject: Re: didPrint selector not called
- From: Jeremy Hughes <email@hidden>
- Date: Fri, 16 Dec 2016 21:54:30 +0000
> On 16 Dec 2016, at 21:40, Quincey Morris <email@hidden> wrote:
>
> On Dec 16, 2016, at 12:01 , Jeremy Hughes <email@hidden> wrote:
>>
>> It’s just an application method, which overrides the method that the system calls from printDocument when a user chooses Print.
>
> Just to be clear, does the “it” in that sentence refer to “printDocumentWithSettings”?
Yes.
> In that case, you don’t know for sure who calls it and when. It appears to documented that it’s called as part of the standard implementation of “printDocument”, but you don’t know if there are other circumstances where it’s called from somewhere else.
>
> AFAICT you are required to invoke the passed-in selector at the correct time. In your case, that’s in your own document:didPrint:contextInfo: method, and therefore (I think) is going to require an invocation because you can’t perform a selector with a non-object parameter. So, yes, you might have to write some Obj-C glue to do this properly.
>
> My guess is that “doing it wrong” is going to be harmless in the case of regular printing from a menu, but it might break if (for example) AppleScript was involved, or something like that. Anyway, it’s your decision what to do. At least you’re aware of the possible issue now.
Thanks. I’ve given up on overriding printDocumentWithSettings and I’m now overriding printDocument instead, following John’s suggestion.
Jeremy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden