gpt4 book ai didi

c# - 在 iOS 13 中访问(File.Copy)共享文件失败

转载 作者:行者123 更新时间:2023-11-29 05:23:38 25 4
gpt4 key购买 nike

我正在使用该方法

File.Copy(url.Path, localAppDataPathWithFile)

在类AppDelegate.cs中的方法OpenUrl中(我使用Xamarin进行开发)。这在 iOS 12 及更低版本中工作,不幸的是在 iOS 13 中我遇到了以下异常:

System.IO.FileNotFoundException: /private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/Downloads/catalog.zip does not exist

当我之前检查文件是否存在( File.Exists(url.Path) )时,我得到了 true。

有谁知道如何解决这个问题或者 iOS 13 发生了什么变化?

最佳答案

我可以通过将 info.plist 键“LSSupportsOpeningDocumentsInPlace”从 true 设置为 false 来解决该问题。

关于c# - 在 iOS 13 中访问(File.Copy)共享文件失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58408239/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com