Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)"

AF解析json出错:

Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)"
(JSON text did not start with array or object and option to allow fragments not set.) UserInfo=0x8a8a700 {NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}

可打印 NSLog(@"operation:
%@", operation.responseString); 服务端返回的结果看看哪里错了

[client getPath:nil
parameters:nil success:^(AFHTTPRequestOperation *operation,id responseObject)

{

NSError *error;

NSDictionary *dict = [NSJSONSerialization
JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves
error:&error];

NSLog(@"operation: %@", operation.responseString);

if (success) {

success(dict);

}

}

failure:^(AFHTTPRequestOperation *operation,NSError *error)

{

NSLog(@"error description:%@",[error
description]);

}];

服务器返回的错误信息:

operation:          ??????{"Result":"1","name":"full","nick":"bfire","sex":"?¥3","email":"","mobi":"","area":"0401","address":"","like":"","photo":"http://weizhuhai.gotoip55.com/upload/member/photo/0/26.jpg","point":"0","coin":"0"}

可以注意到,Result前有串乱码:??????

Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)",码迷,mamicode.com

时间: 2024-07-30 21:55:54

Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)"的相关文章

【解决方法】Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed.

环境:XCODE6.0.1 + iPhone / iOS8 错误:使用CoreLocation获取地理位置信息,报错 Error Domain=kCLErrorDomain Code=0 "The operation couldn't be completed. (kCLErrorDomain error 0.)" 解决方法: 1.确定模拟器(手机)已经联网并且允许程序获取地理位置 2.重置地理位置服务或者网络服务 PS:如果是模拟器就果断直接重置模拟器吧  IOS Simulator

Error Domain=NSURLErrorDomain Code=-999 “The operation couldn’t be completed.

转:http://www.wangzhengdong.com/blog/error-domainnsurlerrordomain-code-999-the-operation-couldnt-be-completed.html – (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { //一个页面没有被完全加载之前收到下一个请求,此时迅速会出现此error,error=-999 //此时可能已经加载完

iOS:Error Domain=WebKitErrorDomain Code=101 "The operation couldn’t be completed. (WebKitErrorDomain

NSString *urlStr = [NSString stringWithFormat:@"%@?uid=%@&uname=%@",KQuestionnaireUrl,model.idStr,model.real_name]; urlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSURL *url = [NSURL URLWithString:urlStr];

CoreData____.sqlite options:(null) ... returned error Error Domain=NSCocoaErrorDomain Code=134100 "T

使用coreData存储数据的时候,运行app就报错CoreData____.sqlite options:(null) ... returned error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn't be completed. (Cocoa error 134100.)". 解决办法:把模拟器里面的原来的app删除就可以了.运行OK.

error = Error Domain=NSCocoaErrorDomain Code=3840

json解析,同样的请求,有一个请求,无反应.纠结了几天,终于解决了. error = Error Domain=NSCocoaErrorDomain Code=3840 "Unescaped control character around character 168." UserInfo={NSDebugDescription=Unescaped control character around character 168.} 报错信息如上: 这个原因,是因为服务器返回的字符串里面

iOS解析JSON字符串报错Error Domain=NSCocoaErrorDomain Code=3840 "Invalid escape sequence around character 586."

将服务器返回的JSON string转化成字典时报错: Error Domain=NSCocoaErrorDomain Code=3840 "Invalid escape sequence around character 586." 仔细查找后在原来解析的基础上将"\"字符替换成""或"\\"后,解析成功.具体的解析代码如下: - (NSDictionary *)parseJsonStringToNSDictionary:(

Error Domain=NSCocoaErrorDomain Code=3840 "Garbage at end." UserInfo={NSDebugDescription=Garbage at end.}

1.\0 导致JSON无法解析的问题,把\0替换成@""即可. 1 NSString *string = @"{\n\t\"responseType\":\t-1\n}\0"; 2 NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding]; 3 4 NSError *error = nil; 5 NSDictionary *dictionary = [NSJSONSerializ

Error Domain=NSCocoaErrorDomain Code=3000 "未找到应用程序的“aps-environment”的授权字符串" UserInfo=0x17426e940 {NS

注册远程通知是报错 Error Domain=NSCocoaErrorDomain Code=3000 "未找到应用程序的"aps-environment"的授权字符串" UserInfo=0x17426e940 {NSLocalizedDescription=未找到应用程序的"aps-environment"的授权字符串} 1. 在X-code中更新证书: Xcode > Preferences > Accounts > pi

Error Domain=NSCocoaErrorDomain Code=3000 "未找到应用程序的“aps-environment”的权利字符串" UserInfo=0x1bad30 {NSLocalizedDescription=未找到应用程序的“aps-environment”的权利字符串}

Error Domain=NSCocoaErrorDomain Code=3000 "未找到应用程序的“aps-environment”的权利字符串" UserInfo=0x1bad30 {NSLocalizedDescription=未找到应用程序的“aps-environment”的权利字符串} code =3000 App ID 和 Bundle Identity不匹配.