On Dec 16, 2016, at 08:45:00, Jeremy Hughes wrote:
Hi,
I’m overriding printDocumentWithSettings in order to get a
notification for when printing has finished, but the didPrint
selector is never called.
This is the code:
class func document(document: NSDocument, didPrint: Bool,
context
> On 16 Dec 2016, at 21:54, Jeremy Hughes wrote:
>
>> 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 calle
> On 16 Dec 2016, at 21:40, Quincey Morris
> wrote:
>
> On Dec 16, 2016, at 12:01 , Jeremy Hughes 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 senten
On Dec 16, 2016, at 12:01 , Jeremy Hughes 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”?
In that case, you don’t
> This is what I’ve currently got. It works OK, but the dictionary conversion
> seems clunky to me.
>
> override func printDocument(sender: AnyObject?)
> {
> let didPrintSelector = #selector(document(_:didPrint:contextInfo:))
>
> let dictionary = printInfo.dictionary()
>
> On 16 Dec 2016, at 20:17, Jeremy Hughes wrote:
>>> I'm not an expert in this part of Cocoa. Are there implicit system
>>> *callers* of this method, or is it more of a system *utility* that you're
>>> expected to call from your own code? If it's the latter, then maybe
>>> instead of overridi
> On 16 Dec 2016, at 20:01, Jeremy Hughes wrote:
>
>>> OK - I misunderstood what Quincey was saying.
>>>
>>> The passed-in delegate and selector are nil, but I obviously can’t be sure
>>> that they will always be nil.
>>>
>>> All I’m actually trying to do is to clean up some objects that need
>> OK - I misunderstood what Quincey was saying.
>>
>> The passed-in delegate and selector are nil, but I obviously can’t be sure
>> that they will always be nil.
>>
>> All I’m actually trying to do is to clean up some objects that need to exist
>> during the print operation. Is this the best w
Also, NSInvocation (used in the release notes sample code) is unavailable in
Swift.
Jeremy
--
> On 16 Dec 2016, at 19:33, Jeremy Hughes wrote:
>
>>
>> On 16 Dec 2016, at 19:29, John McCall wrote:
>>
>>> On Dec 16, 2016, at 11:24 AM, Jeremy Hughes
>>> wrote:
>>> Thanks for the link.
>>>
> On Dec 16, 2016, at 11:33 AM, Jeremy Hughes
> wrote:
>> On 16 Dec 2016, at 19:29, John McCall wrote:
>>
>>> On Dec 16, 2016, at 11:24 AM, Jeremy Hughes
>>> wrote:
>>> Thanks for the link.
>>>
>>> I’ve looked at it, and I don’t think it applies in this case, because I’m
>>> not actually ov
> On 16 Dec 2016, at 19:29, John McCall wrote:
>
>> On Dec 16, 2016, at 11:24 AM, Jeremy Hughes
>> wrote:
>> Thanks for the link.
>>
>> I’ve looked at it, and I don’t think it applies in this case, because I’m
>> not actually overriding the document(_:didPrint:contextInfo:) method, just
>>
> On Dec 16, 2016, at 11:24 AM, Jeremy Hughes
> wrote:
> Thanks for the link.
>
> I’ve looked at it, and I don’t think it applies in this case, because I’m not
> actually overriding the document(_:didPrint:contextInfo:) method, just
> providing it as a callback. There isn’t an override keyword
Thanks for the link.
I’ve looked at it, and I don’t think it applies in this case, because I’m not
actually overriding the document(_:didPrint:contextInfo:) method, just
providing it as a callback. There isn’t an override keyword before the method,
and there isn’t a superclass method that I can
Sorry - I forgot to copy to the list.
Jeremy
--
> Begin forwarded message:
>
> From: Jeremy Hughes
> Subject: Re: didPrint selector not called
> Date: 16 December 2016 at 19:15:10 GMT
> To: John McCall
>
>> On 16 Dec 2016, at 17:24, John McCall wrote:
>>
On Dec 16, 2016, at 08:45 , Jeremy Hughes wrote:
>
> override func printDocumentWithSettings(printSettings: [String : AnyObject],
> showPrintPanel: Bool, delegate: AnyObject?, didPrintSelector: Selector,
> contextInfo: UnsafeMutablePointer)
> {
> let didPrint = #selector(Document.document
> On Dec 16, 2016, at 8:45 AM, Jeremy Hughes
> wrote:
> Hi,
>
> I’m overriding printDocumentWithSettings in order to get a notification for
> when printing has finished, but the didPrint selector is never called.
>
> This is the code:
>
> class func document(document: NSDocument, didPrint: Bo
Hi,
I’m overriding printDocumentWithSettings in order to get a notification for
when printing has finished, but the didPrint selector is never called.
This is the code:
class func document(document: NSDocument, didPrint: Bool, contextInfo:
UnsafeMutablePointer)
{
print("document was pr
17 matches
Mail list logo