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입니다. –