ios - Dropbox 选择器在 iOS 中崩溃
<p><p>我已经在 iOS 应用程序中集成了 Dropbox 选择器。它工作到最近。现在它开始崩溃了。 Dropbox SDK 有什么变化吗?</p>
<p>我可以在选择器中访问保管箱文件 View 并选择文件。但是当它返回到appdelegate时,它就崩溃了。</p>
<p><strong>我得到的 URL 响应:</strong>
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</p>
<p>appdelegate.m 中的代码</p>
<pre><code>- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url sourceApplication:(NSString *)source annotation:(id)annotation
{
if ([ handleOpenURL:url]) {
// This was a Chooser response and handleOpenURL automatically ran the
// completion block
return YES;
}
return NO;
}
</code></pre>
<p>在 <strong>[ handleOpenURL:url]</strong> 行崩溃并出现以下错误:</p>
<pre><code>2016-02-11 15:57:40.413 Backflipt -: unrecognized selector sent to instance 0x37768968
</code></pre>
<p>在 Xcode 的异常断点处检查附加的屏幕截图
<a href="/image/CPGux.png" rel="noreferrer noopener nofollow"><img src="/image/CPGux.png" alt="enter image description here"/></a> </p>
<p>带有最新 Dropbox 选择器的 URL 响应(<strong>版本</strong>:4.2.4):
db-8343b03llcys1pw://1/chooser?<strong>files=</strong>{"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":{}}</p>
<p>带有 Dropbox 选择器的 URL 响应(<strong>版本</strong>:3.9):
db-8343b03llcys1pw://1/chooser?<strong>files</strong>=[{"is_dir":false,"thumbnails":{},"isDir":false,"link":"<a href="https://dl.dropboxusercontent.com/1/view/kdehqo4khfi0ifo/Getting%20Started.pdf" rel="noreferrer noopener nofollow">https://dl.dropboxusercontent.com/1/view/kdehqo4khfi0ifo/Getting%20Started.pdf</a>", "bytes":249159,"name":"Getting Started.pdf","icon":"<a href="https://www.dropbox.com/static/images/icons64/page_white_acrobat.png" rel="noreferrer noopener nofollow">https://www.dropbox.com/static/images/icons64/page_white_acrobat.png</a> "}]</p>
<p>为什么最新的 Dropbox 版本返回单个文件字典而不是文件字典数组,这会导致解析逻辑崩溃。</p>
<p>有什么快速解决方法?编写我们自己的解析逻辑?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>2016 年 2 月 10 日:Dropbox 已意识到并正在解决此问题。</p>
<p>2016 年 2 月 11 日:现在应该在 Dropbox iOS 官方应用的 4.2.5 版中修复此问题。</p></p>
<p style="font-size: 20px;">关于ios - Dropbox 选择器在 iOS 中崩溃,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/35336976/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/35336976/
</a>
</p>
页:
[1]