iOS: Jsonkit

1. Download jsonkit from https://github.com/johnezang/JSONKit 

2. copy JSONKit.h and JSONKit.m files to your project

3. if use ARC, update following setting

iOS: Jsonkit_第1张图片

4 sample codes (记得import JSONKit.h)

    NSString* strUrl=@"xxxx"; //it return json format string
    
    NSURL *url=[NSURL URLWithString:strUrl];
	NSMutableURLRequest  *request=[[NSMutableURLRequest alloc] initWithURL:url];      
    NSError *err=nil;    
    NSData *jsonData=[NSURLConnection sendSynchronousRequest:request
                          returningResponse:nil
                                      error:&err];
    NSDictionary *resultsDictionary = [jsonData objectFromJSONData];
    NSLog(@"resultsDictionary=%@", resultsDictionary );



你可能感兴趣的:(iOS: Jsonkit)