我使用vfr/reader打开 PDF 文件。当我打开第一个 PDF 文件时,我的应用程序会正确打开它,但是当我打开另一个文件时,我的应用程序会再次打开第一个文件。
这是我阅读 PDF 文件的功能
-(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; // Set the ReaderViewController delegate to self
readerViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
readerViewController.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController:readerViewController animated:YES];
}
这是NSLog
输出:
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
我想阅读“ISSUE3_2011/Mathematics.pdf”,但应用程序仍会读取第一个路径“ISSUE2_2011/Mathematics.pdf”
为什么filePath
还是一样?
我怎么解决这个问题?