【发布时间】:2016-09-01 06:24:08
【问题描述】:
我尝试在 WKWebsiteDataStore 的帮助下删除我的 wkwebview cookie,但我的 XCode 6.3.2 不支持 WKWebsiteDataStore。我不愿意升级到 XCode 7。有没有其他选项可以清除来自WKWebview 的 cookie?
【问题讨论】:
我尝试在 WKWebsiteDataStore 的帮助下删除我的 wkwebview cookie,但我的 XCode 6.3.2 不支持 WKWebsiteDataStore。我不愿意升级到 XCode 7。有没有其他选项可以清除来自WKWebview 的 cookie?
【问题讨论】:
不幸的是:没有。这不是Xcode版本的问题,而是iOS版本的问题。正如您在Apple Documentation 中看到的,WKWebsiteDataStore 仅适用于iOS >= 9.0。因此,如果您想使用WKWebsiteDataStore,您必须将iOS 9 设置为Deployment Target。
但是,如果你想使用 iOS9,你必须将你的 XCode 更新到 Xcode7。事实上,你不能在 Xcode as you can read here) 上使用 iOS 9。
总结一下:如果您想使用WKWebsiteDataStore:将您的 Xcode 更新为 7+ 并将 iOS >= 9.0 设置为您的部署目标。
编辑: 经过一番研究,您似乎有另一种方法可以在 iOS > 8.2 上删除 cookie。看看at this answer。但我仍然认为最好的解决方案是进行更新:)
【讨论】: