我已经检查过了,我的 JSon 是有效的。
我尝试使用此代码将其传递给我的应用程序
NSURL *actualURL = [NSURL URLWithString:[serverURLString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSError *errorJson;
NSData *data = [NSData dataWithContentsOfURL:actualURL options:kNilOptions error:nil];
jsonData = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&errorJson];
我在 NSJSONSerialization 中收到 3840 错误代码
jsondata 是(非原子的,强的)NSMutableArray 顺便说一句。
我尝试了许多我在网上找到的解决方案,但它不起作用。
有没有人有任何想法?我认为问题可能是一些正在解析的数据是希腊字符(服务器上的 UTF8_unicode_cl 排序规则)。
这是我的 JSON 示例数据顺便说一句
[{"diseaseID":"18","diseaseName":"测试疾病 1","diseaseDescription":"测试疾病 1 描述","diseaseDoctor":"\u03ba\u03b1\u03c1\u03b4\u03b9\u03bf\u03bb \u03cc\u03b3\u03bf\u03c2","diseaseImagePath":"测试疾病 1"}]
有任何想法吗?