Re: why does print block in Lion?
Re: why does print block in Lion?
- Subject: Re: why does print block in Lion?
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Sat, 17 Sep 2011 23:04:37 +0700
On 17 Sep 2011, at 22:16, Michael Babin wrote:
> On Sep 17, 2011, at 8:02 AM, Gerriet M. Denkmann wrote:
>
>>
>> See comments below:
>>
>>>
>>> In my TestDocument (subclass of NSDocument) I added the following code (see comments inside, which explain what's happening when I do File â∫‚ Print...):
>>>
>>>
>>> - (NSPrintOperation *)printOperationWithSettings:(NSDictionary *)printSettings error:(NSError **)outError
>>> {
>>
>
>> When I remove the call above (runModalPrintOperation...) then it prints ok.
>> The documentation says: "Overrides of printShowingPrintPanel: can invoke this method."
>>
>> Is this a documentation error, and it should be: "Overrides of printShowingPrintPanel: prior to Lion can invoke this method. In Lion it should NOT be used." ?
>>
>> Or am I just confused?
>
> Perhaps I am pointing out the obvious, but you aren't overriding printShowingPrintPanel:, you are overriding printOperationWithSettings:error:. The documentation may be literally correct as is.
Yes, as it turns out: I was really quite confused.
printShowingPrintPanel: is deprecated since 10.4 (but for some reason Xcode failed to tell me this) but it still works in 10.6 and it MUST call runModalPrintOperation..., otherwise there will be no printPanel.
But in Lion it no longer works (blocks in runModalPrintOperation).
>
> I'm not all that familiar with the ins and outs of this particular subset of NSDocument's methods, but is there a reason you wouldn't just return the NSPrintOperation you created from this method and let the caller (presumably printDocumentWithSettings: showPrintPanel: delegate: didPrintSelector: contextInfo:) handle the rest?
You are quite correct, and this is what I am doing right now. And it works in 10.6 and 10.7.
Gerriet.
_______________________________________________
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