# AutomaticCoder **Repository Path**: hennychen/AutomaticCoder ## Basic Information - **Project Name**: AutomaticCoder - **Description**: Automatic generate Objective-C code by JSON string.Support . - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2015-05-21 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Automatic Coder ![截图1](http://zxapi.sinaapp.com/image_library/json1.jpg) ![截图2](http://zxapi.sinaapp.com/image_library/json2.jpg) ## Overview Automatic generate Objective-C code by JSON string.Support \. Do you want other code?Tell me i'll add it. ## System Xcode 4.4 or later Mac OS 10.7 or later ## Feedback ``` NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://zxapi.sinaapp.com"]]; NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; NSDictionary *json = [data objectFromJSONData]; //init object Person *person = [[Person alloc] initWithJson:json]; NSLog(@"%@",person.name); //http://zhangxi.me NSLog(@"%@",person.male?@"男":@"女"); //男 NSLog(@"%ld",person.girlFriends.count); //3 //write to file BOOL result = [NSKeyedArchiver archiveRootObject:person toFile:@"./person.data"]; NSLog(@"%@",result?@"success":@"failure"); //success //read from file Person *thePerson = [NSKeyedUnarchiver unarchiveObjectWithFile:@"./person.data"]; NSLog(@"%@",thePerson.name); //http://zhangxi.me NSLog(@"%@",thePerson.male?@"男":@"女"); //男 NSLog(@"%ld",thePerson.girlFriends.count); ///3 ```