ios - Objective C: Opening A PDF File on iBooks -
i downloading pdf file online server , save app's sandbox view in ibooks.
the ibooks viewing struggling now. tried code:
uidocumentinteractioncontroller *doccontroller = [uidocumentinteractioncontroller interactioncontrollerwithurl:url]; doccontroller.delegate = self; [doccontroller presentopeninmenufromrect:savepdf.frame inview:self.view animated:yes]; [doccontroller dismissmenuanimated:yes];
still gor no chance, running popover being dismissed right away after presented. when deleted [doccontroller dismissmenuanimated:yes];
gives me error saying '-[uipopovercontroller dealloc] reached while popover still visible.'
what problem?
the problem uidocumentinteractioncontroller
being released right after being presented, due variable doccontroller
no longer being in scope.
to prevent that, should create strong
property or instance variable , store uidocumentinteractioncontroller
in there. way, uidocumentinteractioncontroller
stick around until release object controlling it, should long enough user make selection...
Comments
Post a Comment