- // SBJson的代码下载
- // https://github.com/zgGitHub?tab=repositories
-
- NSString*jsonStr=@"{\"name\":\"jia\",\"age\":\"24\"}";
- NSString*jsonStr2=@"[\"1\",\"2\"]";
- SBJsonParser*jsonParser=[[SBJsonParseralloc]init];
- NSMutableDictionary*dict=[jsonParserobjectWithString:jsonStr];
- NSLog(@"%@",dict);
- NSMutableArray*arr=[jsonParserobjectWithString:jsonStr2];
- NSLog(@"%@",arr);
- [jsonParserrelease];
- 无论是数组还是字典都用 objectWithString来解析