我正在使用AFNetworking连接到我们的iPad应用程序的WebDAV服务器(Easy Annotate)。 大多数功能和服务器都能正常工作。
但是,在其中一个测试服务器上创建目录时,应用终止时会显示以下消息:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_NSInlineData URL]: unrecognized selector sent to instance 0x17cc88a0'
崩溃位置:
AFWebDAVManager.m
- (void)createDirectoryAtURLString:(NSString *)URLString
withIntermediateDirectories:(BOOL)createIntermediateDirectories
completionHandler:(void (^)(NSURL *directoryURL, NSError *error))completionHandler
{
__weak __typeof(self) weakself = self;
[self MKCOL:URLString success:^(__unused AFHTTPRequestOperation *operation, NSURLResponse *response) {
if (completionHandler) {
if([response.class.description isEqualToString:@"_NSZeroData"]) {
completionHandler(nil, nil);
}
else {
completionHandler([response URL], nil); <-- CRASH !!!
}
}
} ...
'response'(见上文)的类型为_NSInlineData,值为:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>
我发现了类似的线程,建议在'其他链接器标志'中添加$(继承)。这没有解决问题(或者我犯了错误;))
任何可能导致此次崩溃的想法?
答案 0 :(得分:1)
我们遇到了同样的问题,这是代码中的拼写错误。
它应该是completionHandler([operation.response URL], nil);
最佳, 托马斯