特定の UIView を PDF に保存しようとしましたが、場合によってはクラッシュします。特定の UIView でのクラッシュに注意してください。このコードでは、クラッシュが開始されUIGraphicsEndPDFContext
ますか?
NSMutableData *pdfData = [NSMutableData data];
UIGraphicsBeginPDFContextToData(pdfData,CGRectMake(0, 0, 0,0 ), nil);
// Points the pdf converter to the mutable data object and to the UIView to be converted
// draws rect to the view and thus this is captured by UIGraphicsBeginPDFContextToData
[contentViews enumerateKeysAndObjectsUsingBlock: // Enumerate content views
^(id key, id object, BOOL *stop) {
ReaderContentView *contentView = object;
UIGraphicsBeginPDFPage();
CGContextRef pdfContext = UIGraphicsGetCurrentContext();
[contentView.theContentView.layer renderInContext:pdfContext];
}];
UIGraphicsEndPDFContext();
クラッシュは最初の行にあります
0x33e69884: ldr r2, [r0], #4
0x33e69888: beq 0x33e6989c ; strlen + 36
みんなありがとう!