现在我是这样做的
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies])
{
[storage deleteCookie:cookie];
}但它并不适用于64位的iOS 8设备.
WKWebview的干净饼干还有别的办法吗?任何帮助都将不胜感激。谢谢。
发布于 2015-12-20 00:42:48
迅捷版:
var libraryPath = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.LibraryDirectory, NSSearchPathDomainMask.UserDomainMask, false).first!
libraryPath += "/Cookies"
do {
let result = try NSFileManager.defaultManager().removeItemAtPath(libraryPath)
print(result)
} catch {
print("error")
}
NSURLCache.sharedURLCache().removeAllCachedResponses()https://stackoverflow.com/questions/31289838
复制相似问题