I use vfr / reader to open PDF files. When I open the first PDF file, my application opens it correctly, but when I open another, my application opens the first file again.
This is my function for reading a PDF file.
-(void)readIssue:(IssueMath *)issue { NSString *filePath = [[issue.contentURL path] stringByAppendingPathComponent:@"Mathematics.pdf"]; NSLog(@"Read Path 1: %@ ",filePath); ReaderDocument *document = [ReaderDocument withDocumentFilePath:filePath password:nil]; NSLog(@"Read Path 2: %@ ",document.fileURL); ReaderViewController *readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document]; readerViewController.delegate = self;
And this is the NSLog output:
2012-11-02 20:09:31.081 MAGAZINE[314:15203] Read Path 1: /Users/eakmotion/Library/Application Support/iPhone Simulator/5.0/Applications/EC25BC08-E1E7-44B6-9AD8-0A321EEAC8B6/Library/Caches/ISSUE3_2011/Mathematics.pdf 2012-11-02 20:09:31.109 MAGAZINE[314:15203] Read Path 2: file://localhost/Users/eakmotion/Library/Application%20Support/iPhone%20Simulator/5.0/Applications/EC25BC08-E1E7-44B6-9AD8-0A321EEAC8B6/Library/Caches/ISSUE2_2011/Mathematics.pdf
I want to read "ISSUE3_2011 / Mathematics.pdf", but the application still reads the first path "ISSUE2_2011 / Mathematics.pdf"
Why is filePath the same?
How can I solve this problem?
source share