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
答案 0 :(得分:1)
好吧,因为你没有象征你的崩溃日志,所以很难说出发生了什么。我的猜测是你的pdfContext出来了,你试图在一个带有nil上下文的图层中渲染你的imageView。
我会尝试
if (pdfContext) {
[imageView.layer renderInContext:pdfContext];
}
else {
return;
}