我试图打印一个简单的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, 0, 468, 648)];
    [printView setString:text];
    [[NSPrintOperation printOperationWithView:printView] runOperation];
}

有什么想法吗?

最佳答案

找到答案了!
我需要检查“允许打印”的权利下的总结下,我的目标在项目设置。

07-27 19:00