title: UIPrintInteractionController in iPad is giving me two warnings
body: <p>I am using a code to get Airprint in my app to print the current view as an image.
  the Airprint dialog pops up but in the log screen it shows me two warnings :</p>
  
  <p>1) <strong>WARNING: Calling -[UIPrintInteractionController presentAnimated:completionHandler:] on iPad
  failed to find PDF header: `%PDF' not found.</strong></p>
  
  <p>2)<strong>[UIPopoverController_commonPresentPopoverFromRect:
  inView:permittedArrowDirections:animated:]: the rect passed in to this method must have non-zero width and height. This will be an exception in a future release.</strong></p>
  
  <p>I have already searched in the net but found that all solutions provided for regular rect Button </p>
  
  <p>what I am using here is a segmented control, and I don't know how to use this control in this situation </p>
  
  <p>here is the segment control code :</p>
  
  <pre><code>- (IBAction)legalSegment:(id)sender {
  
  
  switch (((UISegmentedControl *)sender).selectedSegmentIndex) {
      case 0:
      {
          [self printItem];
          break;
      }
  }
  </code></pre>
  
  <p>and this is the printItem method :</p>
  
  <pre><code>-(void)printItem {
  CGRect rect = CGRectMake(0, 0, 768, 1004);
  UIGraphicsBeginImageContext(rect.size);
  CGContextRef context = UIGraphicsGetCurrentContext();
  [self.view.layer renderInContext:context];
  UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
  UIGraphicsEndImageContext();
  
  UIPrintInteractionController* pic = [UIPrintInteractionController sharedPrintController];
  NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(img)];
  if (pic &amp;&amp; [UIPrintInteractionController canPrintData:imageData])
  {
      pic.delegate = self;
      UIPrintInfo* printInfo = [UIPrintInfo printInfo];
      printInfo.outputType = UIPrintInfoOutputPhoto;
      printInfo.jobName = @"PrintingImage";
      printInfo.duplex = UIPrintInfoDuplexLongEdge;
      pic.printInfo = printInfo;
      pic.showsPageRange = YES;
      pic.printingItem = imageData;
  
      void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
          if (!completed &amp;&amp; error) {
              NSLog(@"FAILED! due to error in domain %@ with error code %u", error.domain, error.code);
          }
      };
  
      [pic presentAnimated:YES completionHandler:completionHandler];
  }
  }
  </code></pre>
  
  <p>any help will be great.
  Thanks in advance !</p>