1

Apple はこのレポートで私のアプリを拒否しました:

http://nopaste.me/paste/173567898450806a3c774c4

彼らが言及しているのと同じデバイスとiOS、つまりiPad 3 iOS6を使用して再現することはできません。

画像を PDF に変換してメールで送信する機能について言及しています。そのために、次のコード ブロックを使用します。

-(IBAction)didPressSaveToPDFButton:(id)sender{

   NSMutableData *pdfData = [NSMutableData data];
   UIGraphicsBeginPDFContextToData(pdfData, imageView.bounds, nil);
   UIGraphicsBeginPDFPage();
   CGContextRef pdfContext = UIGraphicsGetCurrentContext();
   [imageView.layer renderInContext:pdfContext];
   UIGraphicsEndPDFContext();

   NSLog(@"PDF");

   MFMailComposeViewController *vc = [[MFMailComposeViewController alloc] init];
   vc.mailComposeDelegate = self;
   [vc setSubject:@"PDF"];
   [vc addAttachmentData:pdfData mimeType:@"application/pdf" fileName:@"mypdf.pdf"];

   [self presentModalViewController:vc animated:YES];
}

レポートが何を指しているのか、および/またはエラーがどこにあるのか、誰にもわかりませんか? 何が悪いのかわかりません。

象徴化されたレポート:

Last Exception Backtrace:
0   CoreFoundation                  0x35e9729e __exceptionPreprocess + 158
1   libobjc.A.dylib                 0x32d1f97a objc_exception_throw + 26
2   UIKit                           0x327e213c -[UIViewController     presentViewController:withTransition:completion:] + 3760
3   UIKit                           0x32904252 -[UIViewController         presentModalViewController:animated:] + 26
4   MyAppName                           0x0009c5a2 -[ViewController didPressSaveToPDFButton:] (ViewController.m:200)
5   UIKit                           0x327e10a8 -[UIApplication sendAction:to:from:forEvent:] + 68
6   UIKit                           0x327e1130 -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 116
4

1 に答える 1

1

クラッシュログを象徴していないので、何が起こっているのかを知るのはかなり難しい. 私の推測では、pdfContext が nil になり、imageView を nil コンテキストのレイヤーにレンダリングしようとしていると思います。

私は試してみます

 if (pdfContext) {
   [imageView.layer renderInContext:pdfContext];
 }
 else {
   return;
 }
于 2012-10-18T21:31:03.050 に答える