我正在將iOS4項目中的代碼塊移植到iOS5,並且我在ARC中遇到了一些麻煩。該代碼從屏幕截圖生成PDF。什麼是「接收器類型'CALayer'實例消息是一個前向聲明」是什麼意思?
PDF代碼
UIView *captureView;
...
NSMutableData *pdfData = [NSMutableData data];
UIGraphicsBeginPDFContextToData(pdfData, captureView.bounds, nil);
UIGraphicsBeginPDFPage();
CGContextRef pdfContext = UIGraphicsGetCurrentContext();
[captureView.layer renderInContext:pdfContext];
UIGraphicsEndPDFContext();
的renderInContext線
[captureView.layer renderInContext:pdfContext];
生成以下錯誤。
Automatic Reference Counting issue
Receiver type 'CALayer' for instance message is a forward declaration
任何想法發生了什麼?
只是要清楚,captureView是一個UIView? – NJones
是的,可能應該添加 - captureView是一個UIView。 –