【问题标题】:Is it possible to search pdf file in whole iphone?是否可以在整个 iphone 中搜索 pdf 文件?
【发布时间】:2011-11-29 07:56:57
【问题描述】:

我想在整个 iphone 上搜索每一个 pdf 文件。在 iphone sdk 中可以吗? 我尝试了以下代码,但它提供了我们自己的应用程序文件。

 NSString *bundleRoot = [[NSBundle mainBundle] bundlePath];
 NSArray *dirContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:bundleRoot error:nil];
 NSArray *onlyPDFs = [dirContents filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"self ENDSWITH '.pdf'"]];

【问题讨论】:

    标签: iphone nsfilemanager


    【解决方案1】:

    每个应用程序(及其关联文件)都在 iOS 下进行沙盒处理,因此您将无法访问除您自己的应用程序生成的文件之外的文件。

    即:这是不可能的。

    【讨论】:

      猜你喜欢
      • 2019-05-09
      • 2012-03-27
      • 1970-01-01
      • 2012-09-25
      • 1970-01-01
      • 1970-01-01
      • 2013-05-10
      • 2011-03-01
      • 2011-06-04
      相关资源
      最近更新 更多