iphone - 将 *.pdf 导入我的应用程序 iphone

标签 iphone ios ios6

如何将 *.pdf 所有 pdf 从我的 iphone 导入到我的应用程序,就像这样添加音乐文件。 http://developer.apple.com/library/ios/#samplecode/AddMusic/Introduction/Intro.html .提前致谢。iphone dev 的新手。非常感谢任何帮助。

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);

最佳答案

您可以将 pdf 文件作为附件通过电子邮件发送,iphone 可以自行阅读。该功能已经存在于 iPhone 的 iOS 中,或者您可以将它们上传到某个地方(在您的服务器上)并发送链接。

关于iphone - 将 *.pdf 导入我的应用程序 iphone,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13855923/

相关文章:

iphone - 倒数计时器 - iPhone

iOS - didSelectRowAtIndexPath 导致应用程序崩溃

iphone - 当应用程序处于后台时,每 X 秒获取一次用户坐标

iphone - sqlite_step(语句)中的 EXC_BAD_ACCESS

iphone - 计算 map 图钉

ios - 重写后从文件加载图像 - UIImage

ios - 编程 IBAction 按钮打开/关闭 map 层

iphone - 查找方向改变后元素的位置

iphone - 振动到声音iPhone

iphone - 我真的需要 MainWindow.xib 文件吗?