1.生成json字符串
NSData * jsonData = [NSJSONSerialization dataWithJSONObject:detailDic options:0 error:nil]; NSString * myString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
2.json解析
NSDictionary * selectSimpleTest = [NSJSONSerialization JSONObjectWithData:[tizhiSimpleTest.detail dataUsingEncoding:NSUTF8StringEncoding] options:0 error:nil];
官方提供的JSON解析
时间: 2024-11-08 16:38:54