2015-09-04 57 views

回答

0
NSString *bundlePath = [[NSBundle mainBundle] resourcePath]; 
    NSFileManager *mgr = [[NSFileManager alloc] init]; 

    NSArray *allFiles = [mgr contentsOfDirectoryAtPath:bundlePath error:NULL]; 
    for (NSString *fileName in allFiles) 
    { 
     if ([[fileName pathExtension] isEqualToString:@"pdf"]) 
     { 
      NSString *fullFilePath = [bundlePath stringByAppendingPathComponent:fileName]; 
      // fullFilePath now contains the path to your pdf file 
     // DoSomethingWithFile(fullFilePath); 

      NSLog(@"file: %@",fullFilePath); 

     } 
    } 

    NSURL *url = [[NSBundle mainBundle] URLForResource:@"" withExtension: @"pdf"]; 

    NSLog(@"File: %@",url); 
+0

先生,我需要我的設備不是我的項目目錄的PDF和文檔,就像我想要任何照片在我的應用程序中導入它打開photoLibrary,我從那裏選擇項目。如果在ibook上運行的pdf相同,我通過我的曲調同步我希望在我的應用程序導入 –

+0

可能這會幫助你http://stackoverflow.com/questions/2594321/how-do-i-launch-ibooks -e-讀者編程方式上的ipad – MrWaqasAhmed

0

你不能在iOS 8(我沒有檢查過9)。您甚至無法在iBooks的共享菜單中登記您的應用程序(添加相應的URL方案)。

相關問題