PDFKit获取错误 - [PDFView setAutoScales:]:发送到实例的无法识别的选择器

时间:2018-05-11 17:37:18

标签: ios objective-c pdfkit

我有像这个教程的代码,但我得到了一个错误

#import <PDFKit/PDFKit.h>
PDFView *View = [[PDFView alloc] initWithFrame: self.view.bounds];
View.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleBottomMargin;
View.autoScales = NO ;
View.displayDirection = kPDFDisplayDirectionHorizontal;
View.displayMode = kPDFDisplaySinglePageContinuous;
View.displaysRTL = YES ;
[View setDisplaysPageBreaks:YES];
[View setDisplayBox:kPDFDisplayBoxTrimBox];
[View zoomIn:self];
[self.view addSubview:View];

NSURL * URL = [[NSBundle mainBundle] URLForResource: @"test" withExtension: @ "pdf" ];
PDFDocument * document = [[PDFDocument alloc] initWithURL: URL];
View.document = document;

但是在构建之后我得到了这个恐怖

'NSInvalidArgumentException', reason: '-[PDFView setAutoScales:]: unrecognized selector sent to instance 0x103519410'

请帮忙! 谢谢!

0 个答案:

没有答案