OGeek|极客世界-中国程序员成长平台

标题: ios - Dropbox 选择器在 iOS 中崩溃 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 14:11
标题: ios - Dropbox 选择器在 iOS 中崩溃

我已经在 iOS 应用程序中集成了 Dropbox 选择器。它工作到最近。现在它开始崩溃了。 Dropbox SDK 有什么变化吗?

我可以在选择器中访问保管箱文件 View 并选择文件。但是当它返回到appdelegate时,它就崩溃了。

我得到的 URL 响应: db-appkey://1/chooser?files=%7B%22link%22%3A%22https%3A%5C%2F%5C%2Fdl.dropboxusercontent.com%5C%2F1%5C%2Fview%5C%2Frsoof482pcg9d1m%5C %2FGet%2520Started%2520with%2520Dropbox.pdf%22%2C%22bytes%22%3A692088%2C%22name%22%3A%22Get%20Started%20with%20Dropbox.pdf%22%2C%22is_dir%22%3Afalse%2C %22icon%22%3A%22https%3A%5C%2F%5C%2Fwww.dropbox.com%5C%2Fstatic%5C%2Fimages%5C%2Ficons64%5C%2Fpage_white_acrobat.png%22%2C%22isDir%22%3Afalse %2C%22thumbnails%22%3A%7B%7D%7D

appdelegate.m 中的代码

- (BOOL)applicationUIApplication *)app openURLNSURL *)url sourceApplicationNSString *)source annotationid)annotation
{
    if ([[DBChooser defaultChooser] handleOpenURL:url]) {
        // This was a Chooser response and handleOpenURL automatically ran the
        // completion block
        return YES;
    }
    return NO;
}

[[DBChooser defaultChooser] handleOpenURL:url] 行崩溃并出现以下错误:

2016-02-11 15:57:40.413 Backflipt[985:420495] -[__NSCFConstantString objectForKeyedSubscript:]: unrecognized selector sent to instance 0x37768968

在 Xcode 的异常断点处检查附加的屏幕截图 enter image description here

带有最新 Dropbox 选择器的 URL 响应(版本:4.2.4): db-8343b03llcys1pw://1/chooser?files={"link":"https://dl.dropboxusercontent.com/1/view/rsoof482pcg9d1m/Get%20Started%20with%20Dropbox.pdf ","bytes":692088,"name":"Dropbox.pdf 入门","is_dir":false,"icon":"https://www.dropbox.com/static/images/icons64/page_white_acrobat. png","isDir":false,"thumbnails":{}}

带有 Dropbox 选择器的 URL 响应(版本:3.9): db-8343b03llcys1pw://1/chooser?files=[{"is_dir":false,"thumbnails":{},"isDir":false,"link":"https://dl.dropboxusercontent.com/1/view/kdehqo4khfi0ifo/Getting%20Started.pdf", "bytes":249159,"name":"Getting Started.pdf","icon":"https://www.dropbox.com/static/images/icons64/page_white_acrobat.png "}]

为什么最新的 Dropbox 版本返回单个文件字典而不是文件字典数组,这会导致解析逻辑崩溃。

有什么快速解决方法?编写我们自己的解析逻辑?



Best Answer-推荐答案


2016 年 2 月 10 日ropbox 已意识到并正在解决此问题。

2016 年 2 月 11 日:现在应该在 Dropbox iOS 官方应用的 4.2.5 版中修复此问题。

关于ios - Dropbox 选择器在 iOS 中崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35336976/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) Powered by Discuz! X3.4