ios - 使用 Dropbox 选择器在 ipad 应用程序中导入 pdf

标签 ios pdf ios6 dropbox dropbox-api

您好,我正在构建一个 iPad 应用程序,我想在其中使用 Dropbox 在我的应用程序中获取我的 pdf 文件。现在我已经尝试了 dropbox sdk,但没有让它工作。我看到他们有一个特殊的保管箱选择器,但仅限于网络。基本想法是获得一个选择器,我可以在其中选择我想在我的自定义 ipad 阅读器中阅读的 pdf。我的问题是之前是否有人已经这样做过,或者是否有人有一些建议我可以从哪里开始?

最佳答案

那么你不需要任何特殊的选择器模块。 Dropbox API 在选择文件及其类型方面非常丰富。使用此代码

- (void)restClient:(DBRestClient*)client loadedMetadata:(DBMetadata*)metadata 
{
    NSMutableArray *pathArray = [[NSMutableArray alloc] init];
    for (DBMetadata *child in metadata.contents) {
        if (!child.isDirectory) {
            NSString *fileExtension = [[child.filename componentsSeparatedByString:@"."] lastObject];
            if ([fileExtension compare:@"pdf" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
             [pathArray addObject:child];
             }
        }
        else {
            [pathArray addObject:child];
        }
    }
}

此 pathArray 仅包含 PDF 文件的列表。检查一下,如果你没有得到任何东西,请告诉我。祝你编码愉快。!!干杯。!!

关于ios - 使用 Dropbox 选择器在 ipad 应用程序中导入 pdf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13830819/

相关文章:

iphone - 自定义单元格,只有最后一个单元格获得 [layoutSubviews]?

pdf - 在Apps脚本中将单页导出为PDF

python - 结构错误 : unpack requires a string argument of length 16

ios6 - Apple 因为使用 MTStatusBarOverlay 而拒绝了我的应用程序?

ios - MKStoreKit 错误

iphone - 在后台运行时如何检测密码文本字段?

ios - UICollectionView 单元配置次数过多

ios - 从 TextFieldOnEditingDidEnd 内部调用 BecomeFirstResponder 时,iOS 6.1 中的 StackOverflow

ios - 为什么我的数据没有在我的 Ionic 2 View 中呈现?

c# - Internet Explorer PDF 阅读器