I am trying to use this PDFScroller code http://dl.dropbox.com/u/5391413/PDFScroller.zip (thanks jbm). I would like to display a pdf from a list (a tableview) thanks to a navigationController. I init a PhotoViewControler with a pdf file name and display it correctly. The problem is that after I have loaded a file once, I don't manage to clean the pdfDoc ref and this causes a crash after coming back to the view list and loading another file.
I tried to release the pdfDoc ref, or set to nil in the PhotoViewController dealloc method but it does not work. One more thing: the viewDidUnload method of the PhotoViewController is not called when popping the viewController out of the navigationcontroller stack... is that normal?
thanks
G.
here is how I launch a PhotoViewController from he root viewController:
tmpName contains the name of the pdf file, I set a property in the PhotoViewController.Here is the PhotoViewController implementation (little different from the original sample code):
The problem is: in the
- (CGPDFPageRef) pdfPage: (NSInteger) index
method, __pdfDoc remains the same even after the PhotoViewController was popped off the navigationController stack, and this causes a crash. I don't where to clean it correctly.thanks
Guillaume