ios - PDF in UIWebView not working -
i have 2 uipopovercontroller
. each 1 opens pdf in uiwebviewdelegate
when click respective buttons. however,only 1 works. both buttons, , b, have format click function (except button b buttonb not buttona)
- (ibaction)openpdf_pictures_a:(id)sender { buttonapdfviewcontroller *dwv =[[buttonapdfviewcontroller alloc] initwithnibname:nil bundle:nil]; self.masterpopovercontroller = [[uipopovercontroller alloc] initwithcontentviewcontroller:dwv]; [self.masterpopovercontroller presentpopoverfromrect:[sender frame] inview:[sender superview] permittedarrowdirections:uipopoverarrowdirectionany animated:yes]; [self.masterpopovercontroller setpopovercontentsize:cgsizemake(600, 800) animated:no]; }
and in uiviewcontroller each uiwebview, this:
#import "buttonaviewcontroller.h" @interface buttonaviewcontroller () @end @implementation buttonaviewcontroller @synthesize buttonapdfview; - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { self = [super initwithnibname:nibnameornil bundle:nibbundleornil]; if (self) { // custom initialization } return self; } - (void)viewdidload { [super viewdidload]; nsstring *path = [[nsbundle mainbundle] pathforresource:@"parta" oftype:@"pdf"]; nsurl *targeturl = [nsurl fileurlwithpath:path]; nsurlrequest *request = [nsurlrequest requestwithurl:targeturl]; [buttonapdfview loadrequest:request]; } - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } @end
both buttons , b on same view. did make 1 of ibactions use masterpopovercontroller2 , 1 of masterpopovercontroller see if resolve doesn't. 1 doesn't work opens popover doesn't show pdf in popover. suggestions?
just realized didn't add uiwebview inside uiview in xib...
Comments
Post a Comment