AutomaticCoder
- 授权协议: 未知
- 开发语言: Objective-C
- 操作系统: iOS
- 软件首页: https://github.com/zhangxigithub/AutomaticCoder
软件介绍
Automatic Coder 可根据 JSON 字符串自动生成对应的 Objective-C 处理代码。
示例代码:
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
HTML5经典实例
Christopher Schmitt、Kyle Simpson / 李强 / 中国电力出版社 / 2013-7 / 48.00元
《HTML5经典实例》对于从中级到高级的Web和移动Web开发者来说是绝佳之选,它帮助你选择对你有用的HTML5功能,并且帮助你体验其他的功能。个技巧的信息十分丰富,都包含了示例代码,并详细讨论了解决方案为何有效以及如何工作。一起来看看 《HTML5经典实例》 这本书的介绍吧!
