2015-09-04 56 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方案)。

相关问题