运行时错误
2017-08-27 00:47:37.242 wesg-debug[41532:2396580] ERROR: createEncodedCachedResponseAndRequestForXPCTransmission - Invalid protocol-property list - CFURLRequestRef. protoProps=<CFBasicHash 0x6080014749c0 [0x103862e40]>{type = mutable dict, count = 1,
entries =>
2 : <CFString 0x101d67850 [0x103862e40]>{contents = "connection_register"} = <TBSDKRequestDelegate: 0x60800000f2b0>
}
2017-08-27 00:47:37.242 wesg-debug[41532:2396580] ADD: failed to create cache dictionary at path=/Users/f7/Library/Developer/CoreSimulator/Devices/9469E40A-F450-4182-85AD-5037FF357A59/data/Containers/Data/Application/8382C52F-3CDD-4DB0-BC44-8E53C2E7D3F4/Library/Caches/com.alisports.wesg. key=0x608001471740
WKWebsiteDataStore 清理缓存api
- (void)removeDataOfTypes:(NSSet<NSString *> *)dataTypes forDataRecords:(NSArray<WKWebsiteDataRecord *> *)dataRecords completionHandler:(void (^)(void))completionHandler;
completionHandler 不能为空?但是why??
[self.wkWebView.configuration.websiteDataStore removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate dateWithTimeIntervalSince1970:0] completionHandler:nil];
警告:Null passed to a callee that requires a non-null argument…
崩溃测试
- (void)viewDidLoad {
[super viewDidLoad];
self.wkWebView = [[WKWebView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:self.wkWebView];
///////////////////
[self.wkWebView.configuration.websiteDataStore removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate dateWithTimeIntervalSince1970:0] completionHandler:nil];
///////////////////
[self.wkWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.baidu.com"]]];
}
崩溃!!!
疑问
为何崩溃呢?有知者请指教。