ios - FastPDFkit Custom class issue -
i using fastpdfkit - third party ios library rendering pdfs , performing custom operations such save, favorite, email etc. on it. since long, using 32-bit version.
now, want upgrade 64-bit. tried integrate new fastpdfkit framework. made small poc controller suggested library. worked fine below:
-(ibaction)actionopenplaindocument:(id)sender{ /** set document name */ nsstring *documentname = @"manual"; // manual indicates catalog name /** temporary directory save thumbnails */ nsarray *paths = nssearchpathfordirectoriesindomains(nscachesdirectory, nsuserdomainmask, yes); /** set thumbnails path */ nsstring *thumbnailspath = [[paths objectatindex:0] stringbyappendingpathcomponent:[nsstring stringwithformat:@"%@",documentname]]; /** document app bundle */ nsurl *documenturl = [nsurl fileurlwithpath:[[nsbundle mainbundle]pathforresource:documentname oftype:@"pdf"]]; /** instancing documentmanager */ mfdocumentmanager *documentmanager = [[mfdocumentmanager alloc]initwithfileurl:documenturl]; /** instancing readerviewcontroller */ readerviewcontroller *pdfviewcontroller = [[readerviewcontroller alloc]initwithdocumentmanager:documentmanager]; /** set resources folder on manager */ documentmanager.resourcefolder = thumbnailspath; /** set document id thumbnail generation */ pdfviewcontroller.documentid = documentname; /** present pdf on screen in modal view */ [self presentviewcontroller:pdfviewcontroller animated:yes completion:nil]; /** release pdf controller*/ // [pdfviewcontroller release]; }
this code works fine default components. here, readerviewcontroller
is controller suggested fastpdfkit open pdf.
in fastpdfkit header files, checked readerviewcontroller
derived mfdocumentviewcontroller
. this:
@interface readerviewcontroller : mfdocumentviewcontroller <mfdocumentviewcontrollerdelegate
note: both readerviewcontroller & mfdocumentviewcontroller of fastpdfkit framework , have .h files of them.
now, created custom class iphonepdfviewcontroller
.
and tried similar operations it
@interface iphonepdfviewcontroller : mfdocumentviewcontroller <mfdocumentviewcontrollerdelegate
and in implentation:
iphonepdfviewcontroller *viewcontroller = [[iphonepdfviewcontroller alloc] initwithdocumentmanager:documentmanager]; viewcontroller.documentname = @"manual";//i took pdf other way. documentmanager.resourcefolder = thumbnailspath; viewcontroller.documentid = documentname; [self.navigationcontroller pushviewcontroller:viewcontroller animated:yes];
but crashing saying:
*** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '*** -[__nsplaceholderdictionary initwithobjects:forkeys:count:]: attempt insert nil object objects[0]' *** first throw call stack: ( 0 corefoundation 0x030b9746 __exceptionpreprocess + 182 1 libobjc.a.dylib 0x04428a97 objc_exception_throw + 44 2 corefoundation 0x02fafc93 -[__nsplaceholderdictionary initwithobjects:forkeys:count:] + 451 3 corefoundation 0x02fc3b7b +[nsdictionary dictionarywithobjects:forkeys:count:] + 75 4 catalogapp 0x00249e4b priorityforoffset + 41190 5 catalogapp 0x00247f34 priorityforoffset + 33231 6 catalogapp 0x000d93e8 -[iphonepdfviewcontroller viewdidload] + 72 7 uikit 0x00eeada4 -[uiviewcontroller loadviewifrequired] + 771 8 uikit 0x00f227bd -[uinavigationcontroller _layoutviewcontroller:] + 42 9 uikit 0x00f22d2c -[uinavigationcontroller _updatescrollviewfromviewcontroller:toviewcontroller:] + 235 10 uikit 0x00f22e30 -[uinavigationcontroller _starttransition:fromviewcontroller:toviewcontroller:] + 90 11 uikit 0x00f23dd5 -[uinavigationcontroller _startdeferredtransitionifneeded:] + 669 12 uikit 0x00f24a51 -[uinavigationcontroller __viewwilllayoutsubviews] + 57 13 uikit 0x0109e750 -[uilayoutcontainerview layoutsubviews] + 213 14 uikit 0x00e1957a -[uiview(calayerdelegate) layoutsublayersoflayer:] + 668 15 libobjc.a.dylib 0x0443e771 -[nsobject performselector:withobject:] + 70 16 quartzcore 0x021bfe47 -[calayer layoutsublayers] + 144 17 quartzcore 0x021b3925 _zn2ca5layer16layout_if_neededepns_11transactione + 403 18 quartzcore 0x021b377a _zn2ca5layer28layout_and_display_if_neededepns_11transactione + 26 19 quartzcore 0x0210fc52 _zn2ca7context18commit_transactionepns_11transactione + 284 20 quartzcore 0x021110e5 _zn2ca11transaction6commitev + 487 21 quartzcore 0x021117fc _zn2ca11transaction17observer_callbackep19__cfrunloopobservermpv + 92 22 corefoundation 0x02fda86e __cfrunloop_is_calling_out_to_an_observer_callback_function__ + 30 23 corefoundation 0x02fda7b0 __cfrunloopdoobservers + 400 24 corefoundation 0x02fd01ea __cfrunlooprun + 1226 25 corefoundation 0x02fcfa5b cfrunlooprunspecific + 443 26 corefoundation 0x02fcf88b cfrunloopruninmode + 123 27 graphicsservices 0x055262c9 gseventrunmodal + 192 28 graphicsservices 0x05526106 gseventrun + 104 29 uikit 0x00d86106 uiapplicationmain + 1526 30 catalogapp 0x0007e36a main + 138 31 libdyld.dylib 0x05b61ac9 start + 1 32 ??? 0x00000001 0x0 + 1 ) libc++abi.dylib: terminating uncaught exception of type nsexception
Comments
Post a Comment