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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -