I'm parsing json with SBJson.
I receive an error "-JSONValue failed. Error is: Unescaped control character [0x09]" when parsing my json string, it has unencoded tab. How to replace this tab in my json string to \t? If i remove tab manualy, everything is good. Or how to encode this tab properly?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can use stringByReplacingOccurrencesOfString:withString:
:
NSString * newJsonString = [oldJsonString stringByReplacingOccurrencesOfString:@"\t" withString:@"\\t"];