Hello,
Upon the [pic presentAnimated:YES completionHandler:completionHandler] calls, I get this warning from the console:
Unbalanced calls to begin/end appearance transition for <UIViewController: 0x....> . It doesn't crash though, and I don't see this warnings from the iPad.
Does anybody get this message too?
Thanks!
-(void)BA_handlePrintTapped:(id)sender {
[SVProgressHUD showLoading];
UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
pic.delegate = self;
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = @"my job;
printInfo.duplex = UIPrintInfoDuplexLongEdge;
pic.printInfo = printInfo;
pic.showsPageRange = YES;
UIMarkupTextPrintFormatter *textPrint = [[UIMarkupTextPrintFormatter alloc] initWithMarkupText:[NSString stringWithFormat:@"<html>test test</html"];
NSLog(@"html is %@", textPrint.markupText);
pic.printFormatter = textPrint;
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
[SVProgressHUD dismiss];
if(completed) {
NSLog(@"complete");
}
else {
NSLog(@"failed");
}
};
if(IDIOM == IPAD) {
[pic presentFromBarButtonItem:self.printBarButton animated:YES completionHandler:completionHandler];
}
else {
[pic presentAnimated:YES completionHandler:completionHandler];
}
}