0

以下对 NSPrintOperation 的简单调用开始运行非常缓慢并旋转色轮:

NSPrintInfo* printInfo = [NSPrintInfo sharedPrintInfo];
NSPrintOperation* opeation = [NSPrintOperation printOperationWithView:[self view] printInfo:printInfo];
[opeation runOperation];

使用以下登录控制台:

12:00:37.659430+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
12:00:38.660534+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 2
12:00:39.662490+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 3
12:00:40.663736+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:8 Err:-1 Errno:1 Operation not permitted
12:00:40.666875+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
12:00:41.667635+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 2
12:00:42.668884+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 3
12:00:43.669116+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:8 Err:-1 Errno:1 Operation not permitted
12:00:43.694588+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
12:00:44.694744+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 2
12:00:45.696010+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 3
12:00:46.697261+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:8 Err:-1 Errno:1 Operation not permitted
12:00:46.720609+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
12:00:47.720890+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 2
12:00:48.721326+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 3
12:00:49.721529+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:8 Err:-1 Errno:1 Operation not permitted
12:00:49.726589+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
12:00:50.727795+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 2
12:00:51.728552+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect()-> No of tries: 3
12:00:52.728778+0300 PrintTest[2196:128061] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:8 Err:-1 Errno:1 Operation not permitted

看起来它是在升级到 macOS 10.14 后开始的。它仅在启用沙盒时发生。检查打印权限。其他沙盒应用程序,如 Preview 和 TextEdit 似乎不受此影响,并快速开始打印对话框。有什么想法可以解决这个问题吗?

4

0 回答 0