upgrade iOS
to iOS11
, my PDF reader stop working, and the app crash for unrecognize selector calling all property of the object
@interface PDFScrollView : UIScrollView <UIScrollViewDelegate>
// Frame of the PDF
@property (nonatomic) CGRect pageRect;
// A low resolution image of the PDF page that is displayed until the TiledPDFView renders its content.
@property (nonatomic, strong) UIView *backgroundImageView;
// The TiledPDFView that is currently front most.
@property (nonatomic, strong) TiledPDFView *tiledPDFView;
// The old TiledPDFView that we draw on top of when the zooming stops.
@property (nonatomic, strong) TiledPDFView *oldTiledPDFView;
// Current PDF zoom scale.
@property (nonatomic) CGFloat scale;
@property (nonatomic) CGPDFPageRef PDFPage;
-(void)replaceTiledPDFViewWithFrame:(CGRect)frame;
@end
if I try to get or set scale or PDFPage
or tiledPDFView
.
I got the unrecognize error:
-[PDFScrollView tiledPDFView]: unrecognized selector sent to instance 0x7fd3d28dbc00
-[PDFScrollView tiledPDFView]: unrecognized selector sent to instance 0x7fd3d28dbc00
(null)
some detail of the class:
@interface PDFScrollView : UIScrollView <UIScrollViewDelegate>
@property (nonatomic) CGRect pageRect;
@property (nonatomic, strong) UIView *backgroundImageView;
@property (nonatomic, strong) TiledPDFView *tiledPDFView;
@property (nonatomic, strong) TiledPDFView *oldTiledPDFView;
I think is a iOS11
bug, how can I fix it ??
We had a similar issue. Our exception was this:
-[PDFPasswordViewController setPdfURL:]: unrecognized selector sent to instance 0x101479240
You won't believe this, but we've changed our class name to something that doesn't begin with "PDF".
Previously it was PDFPasswordViewController
and we added a prefix, something like XXPDFPasswordViewController
. And this is it, now it works as before.
Honestly, we don't know what's causing this, but we think it may be something related to PDFKit that was introduced in iOS 11.