November 2013
Intermediate to advanced
576 pages
19h 3m
English
It is always important to gracefully handle errors, even more so while printing. With printing, there are any number of things that can go wrong outside of the developer’s control, from out-of -paper issues to the printer not even being on.
The sample app defines a new block called completionHandler. This is used to handle any errors that are returned from the print job. In the next section, you will begin a new print job with the completionHandler block as one of the arguments.
void (^completionHandler)(UIPrintInteractionController *,BOOL, NSError *) = ^(UIPrintInteractionController *print,BOOL completed, NSError *error){ if (!completed && error) { NSLog(@"Error!"); }};
Read now
Unlock full access