JSONKit使用示例
导入JSONKIT和dylib
将json转换为NSDictionary
NSString *string = @"{\"name\": \"My Name\",\"list\": [\"one\",\"two\",\"three\"]}";
NSData* jsonData = [string dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *resultsDictionary = [jsonData objectFromJSONData];
NSLog(@"55----%@",resultsDictionary);
将NSDictionary转换为 json格式的string
//resultsDictionary是需要转换的dictionary
NSString *string = [[NSString alloc] initWithData:[resultsDictionary JSONData] encoding:NSUTF8StringEncoding];
补充:web前端 , JavaScript ,