Using WKWebsiteDataStore on XCode 6.3.2

时间:2016-09-01 06:24:08

标签: xcode cookies wkwebview

I tried to delete my wkwebview cookies with the help of WKWebsiteDataStore, but WKWebsiteDataStore is not supported by my XCode 6.3.2. I am not willing to upgrade to XCode 7. Is there any other option to clear the cookies from WKWebview?

1 个答案:

答案 0 :(得分:1)

不幸的是:没有。这不是Xcode版本的问题,而是iOS版本的问题。正如您在Apple Documentation中所读到的那样,WKWebsiteDataStore仅适用于iOS >= 9.0。因此,如果您想使用WKWebsiteDataStore,则必须将iOS 9设为Deployment Target

但是,如果你想使用iOS9,你必须将你的XCode更新为Xcode7。实际上,你不能在Xcode上使用iOS 9< 7(as you can read here)。

所以,总结一下:如果你想使用WKWebsiteDataStore:将你的Xcode更新为7+,并在部署目标时设置iOS> = 9.0。

修改 经过一些研究,看来你有另一种方法可以删除iOS上的cookies> 8.2。看看at this answer。但我仍然认为最好的解决方案是进行更新:)