I have tried to use the source code from 'developer.apple.com' and displayed a PDF file. The difference in my code is that I am using a Nib file to add some additional features. I'm only using PDFScrollView and TiledPDFView class files from source code when I try to call method [[PDFScrollView *] self.view setPDFPage: PDFPage]; I get the following error:
Smart_Reader [408: f803] - [UIView setPDFPage:]: Unexpected selector sent for example 0x6ea09b0 Smart_Reader [408: f803] * * end the app due to no exception * '' NSInvalidArgumentException ', reason:' - [UIView setPDFPage:]: 0x6ea09b0 for example unrecognized selector ' * before throwing the call stack: (0x1283022 0x183bcd6 0x1284cbd 0x11e9ed0 0x11e9cb2 0x2a49 0x489e29 0x489133 0x48a3bf 0x48ca21 0x48c97c 0x4853d7 0x1ea1a2 0x1ea532 0x1d0dc4 0x1c4634 0x2176ef5 0x1257195 0x11bbff2 0x11ba8da 0x11b9d84 0x11b9c9b 0x21757d8 0x217588a 0x1c2626 0x1e5d 0x1dc5) an exception Fen The call ended
I am very new to the objective-c and this is my first post on stackoverflow.com. I would appreciate any help from this great community
PDFReader.h
#import & lt; UIKit / UIKit.h & gt; #import & lt; Quartzcore / Quartzcore H & gt; @ Interface reader viewer: UIViewController // & lt; UIScrollViewDelegate & gt; {IBOutlet UILabel * TapLabel; } - (zero) handle lensing tape: (UITapGestureRecognizer *) identifier; @end
PDFReader.m
#import "ReaderViewController.h" #import & lt; Quartzcore / Quartzcoreot & gt; #import "TiledPDFView.h" #import "PDFScrollView.h" #import "singleton.h" @ Interface Reader Viewer () @end @implementationReaderViewController {} - View (zero) viewDidload {[Super Viewedload]; Self.view.backgroundColor = [UIColor clear collar]; NSDictionary * infoDictionary = [[NSBundle main bundle] infoDictionary]; NSString * name = [infoDictionary objectForKey: @ "Knowledge works knowledge"]; NSString * version = [infoDictionary objectForKey: @ "CFBundleVersion"]; Self.title = [NSString stringWithFormat: @ "GENIUS READER", name, version]; TapLabel.backgroundColor = [UIColor clear collar]; TapLabel.textColor = [UIColor whiteColor]; TapLabel.textAlignment = UITextAlignmentCenter; TapLabel.font = [UIFont systemFontOfSize: 24.0f]; UITapGestureRecognizer * singleTap = [[UITapGestureRecognizer alloc] initWithTarget: Auto Action: @Selector (HandtingTalap :)); SingleTap.numberOfTouchesRequired = 1; SingleTap.numberOfTapsRequired = 1; //singleTap.delegate = self; [Self.view addGestureRecognizer: singletap]; } - (zero) viewDidUutup {[SuperWooddownload]; } - (BOOL) Required Arbitrator Interface Operation (UINPference Orientation) Interface Orientation {Return Yes; } - (zero) handle lensingtap: (UITapGestureRecognizer *) identifier {NSInteger Totalpages; NSURL * pdfURL = [[NSBundle Main Bundle] URLForResource: Extension with @ "fw4": @ "PDF"]; CGPDFDocumentRef myDocument; MyDocument = CGPDFDocumentCreateWithURL ((__ Bridge CFRRRF) PDF URL); // 1 if (Microsoft == faucet) {// 2 CFRlise ((__Briffleff) PDFFRL); } CFRelease ((__bridge seborough) pdfURL); Kulpage = CGPDFDGGatnumber of pages (My Documents); If (total page == 0) {// 5 CGPDFDocumentRelease (myDocument); } CGPDF paged PDFPage = CGPDFDCastGetpage (MICA Document, 1); // [c set pdf page: pdf page]; // PDFScrollView * PDFview = [[PDFScrollView alloc] init]; // [PDF view set pdf page: pdf page]; //[self.view addSubview: [Singleton Glappadata]. Testington]; [[PDFScrollView *] Self.view Set PDFPage: PDFPage]; } @end
It seems that you are using only the code that In the example that Apple has given,
make sure that you have connected IBOutlets in IB if you are using it
(or)
Ensure that you have started in PDFDialViewViewDidLoad if you are not using IB
view this answer - & gt;
Comments
Post a Comment