我有这个代码来做 AirPrint 文本视图文本
-(IBAction)_clickbtnprintermainnote:(id)sender
{
UIPrintInteractionController *print = [UIPrintInteractionController sharedPrintController];
print.delegate = self;
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName =@"Nots of MyBibleApp";
printInfo.duplex = UIPrintInfoDuplexLongEdge;
print.printInfo = printInfo;
print.showsPageRange = YES;
print.printingItem = _txtmainnote.text;
void (^completionHandler)(UIPrintInteractionController *,BOOL, NSError *) = ^(UIPrintInteractionController *print,BOOL completed, NSError *error) {
if (!completed && error) {
NSLog(@"houston we have a problem");
}
};
[print presentAnimated:YES completionHandler:completionHandler];
}
但我没有像 iPad 中的默认 pinter 选项那样弹出任何打印机选项弹出窗口。我没有使用条形按钮,我有一个 UIbutton。如何正确执行此操作,我的代码有什么错误吗?._txtmainnote 是我的文本视图.
提前致谢。