在我的iOS 5应用程序中,我有一个NSString包含JSON字符串的应用程序.我想将JSON字符串表示反序列化为本机NSDictionary对象.
"{\"password\" : \"1234\", \"user\" : \"andreas\"}"
Run Code Online (Sandbox Code Playgroud)
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:@"{\"2\":\"3\"}"
options:NSJSONReadingMutableContainers
error:&e];
Run Code Online (Sandbox Code Playgroud)
-[__NSCFConstantString bytes]: unrecognized selector sent to instance 0x1372c
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[__NSCFConstantString bytes]: unrecognized selector sent to instance 0x1372c'
Run Code Online (Sandbox Code Playgroud) 我希望解码下面的JSON数据:
{
"content":
[
{
"1":"a",
"2":"b",
"3":"c",
"4":"d",
"mark":"yes"
}
]
}
Run Code Online (Sandbox Code Playgroud)
不确定是否将它放在NSArray或NSDictionary中
欢迎任何评论