Reputation: 9590
I am trying to print a simple NSString value. But It gives me a dialog saying:
"Printing Now Allowed
This application is not allowed to print.
Please contact your application vendor for an update."
The code I use is:
-(void)printText:(NSString*)text
{
NSTextView *printView = [[NSTextView alloc] initWithFrame:NSMakeRect(0, 0, 468, 648)];
[printView setString:text];
[[NSPrintOperation printOperationWithView:printView] runOperation];
}
Any ideas?
Upvotes: 12
Views: 3020
Reputation: 1576
Go to Capabilities and to app Sandbox and then find under Hardware the checkmark for "PRINTING"
Upvotes: 9
Reputation: 389
Go to Your Project ---> YourProject.entitlements Add the following Key-Value
com.apple.security.print - YES
For more info
Upvotes: 4
Reputation: 9590
Found the answer!
I needed to check "Allow printing" under Entitlements under Summary under my target in project settings.
Upvotes: 22