回答
您可以將Core Graphics用於此任務。 看PDFView樣品從蘋果資源
有一個可用here一個很好的教程演示如何打開的.pdf,.xls的應用程序中的文件。
您必須參考的主要類是QLPreviewController
。 here
這是數據源的方法,你就必須調用該
- (id <QLPreviewItem>)previewController: (QLPreviewController *)controller previewItemAtIndex:(NSInteger)index
{
// Break the path into it's components (filename and extension)
NSArray *fileComponents = [[arrayOfDocuments objectAtIndex: index] componentsSeparatedByString:@"."];
// Use the filename (index 0) and the extension (index 1) to get path
NSString *path = [[NSBundle mainBundle] pathForResource:[fileComponents objectAtIndex:0] ofType:[fileComponents objectAtIndex:1]];
return [NSURL fileURLWithPath:path];
}
也有人想提及這太問題:iPhone - Opening word and excel file without using UIWebview。
這是否打開不在我的應用程序捆綁,但它是在iPad的PDF文件? – 2012-03-13 08:51:47
@anonymous,現在即使在Monish感到不安之後,你仍然在回答......親愛的'anonymous',這是一個社區,你應該對你的話更有禮貌。每個人都來這裏學習和分享他們的知識.. – samfisher 2012-03-13 08:57:05
@samfisher:是的隊友..我完全同意我們必須要有禮貌。但我爲這個社區而回答。這個答案適用於那些真正關心搜索解決方案的人,偶然他們點擊這裏,他們不會得到答案而不去。 – 2012-03-13 09:52:49
- 1. 如何從我自己的應用程序打開iphone郵件應用程序?
- 2. 如何從我自己的應用程序打開iPhone設置?
- 3. 我如何在iphone應用程序中打開DST文件?
- 4. 如何在我的iPhone應用程序中導入和使用我的應用程序中的.db文件sdk
- 5. 我如何使我的iPad安全使用我自己的(密碼保護)應用程序在iphone sdk
- 6. 在iPhone SDK 3.2中無法打開打開的應用程序
- 7. AndroidPDFViewer - 無法在我的應用程序中打開pdf文檔
- 8. 我無法在我的android應用程序中打開PDF
- 9. 如何在我的黑莓應用程序中打開PDF文件?
- 10. 如何通過我的Android應用程序打開PDF文件?
- 11. 如何在我的ipad應用程序中打開.IBA文件
- 12. 設置我自己的字體在我的應用程序iPhone SDK的
- 13. 如何在java應用程序中使用我自己的sikuli文件
- 14. 如何在iphone中自動打開文件到iphone應用程序中?
- 15. 如何在cakephp中使用我自己的應用程序中的插件?
- 16. 在我自己的頭文件中的類iPhone應用程序拒絕audioPlayerDidFinishPlaying
- 17. 使用「打開方式」不會在我的應用程序中打開文件
- 18. 如何在Drive-sdk中指明我的應用程序可以使用mimeType打開文件:'application/vnd.google-apps.drive-sdk'?
- 19. 如何在Cordova/Ionic應用程序中打開PDF文件?
- 20. 在Safari中打開應用程序包中的PDF? iPhone
- 21. 如何打開我們的應用程序中的其他應用程序iphone
- 22. 用自己的C#應用程序打開自定義文件
- 23. Iphone SDK-如何在我的應用程序中插入橫幅
- 24. Ionic 2 - 在我的應用程序中打開外部PDF
- 25. 在我的iPhone應用程序中從Safari中打開GPX文件
- 26. 如何在iphone應用程序中打開xls文件?
- 27. 如何在iphone地圖應用程序中打開KML文件?
- 28. 在iphone應用程序中使用objective-c打開.indd文件?
- 29. 如何從我的應用程序中打開iPhone日曆?
- 30. 在我的應用程序中打開藍牙設備iphone
你在提問之前搜索過嗎? – 2012-03-13 08:49:04
可能的重複:http://stackoverflow.com/questions/6983502/iphone-opening-word-and-excel-file-without-using-uiwebview – 2012-03-13 08:53:06
「我怎樣才能打開PDF文件...」幾乎不是重複的「打開word和excel文件」:-) – 2012-03-13 09:16:54