我現在NSJSONSerialization
在解析JSON
NSData *jsonData = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"url"]];
NSError *jsonError = nil;
id jsonObject = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&jsonError];
NSDictionary *jsonDictionary = (NSDictionary *)jsonObject;
[self setTableData:jsonDictionary];
解析但它不會解析因爲JSON特殊字符,如字母「U」我的JSON當我刪除'ü'來自JSON,它的工作正常。我試過上面的代碼和:
options:utf8...
有誰知道我該如何解決這個問題?
您的字符串編碼錯誤/轉換。如果編碼正確並且UTF8轉換爲Unicode,那麼JSON將沒有問題。 –