加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

objective-c – OSX应用程序中的“不允许打印”

发布时间:2020-12-16 07:53:23 所属栏目:百科 来源:网络整理
导读:我正在尝试打印一个简单的NSString值.但它给了我一个对话: "Printing Now AllowedThis application is not allowed to print.Please contact your application vendor for an update." 我使用的代码是: -(void)printText:(NSString*)text{ NSTextView *pri
我正在尝试打印一个简单的NSString值.但它给了我一个对话:
"Printing Now Allowed

This application is not allowed to print.

Please contact your application vendor for an update."

我使用的代码是:

-(void)printText:(NSString*)text
{
    NSTextView *printView = [[NSTextView alloc] initWithFrame:NSMakeRect(0,468,648)];
    [printView setString:text];
    [[NSPrintOperation printOperationWithView:printView] runOperation];
}

有任何想法吗?

解决方法

找到答案了!

我需要在项目设置中的目标下的“摘要”下的“权利”下选中“允许打印”.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读