{"id":20613594,"url":"https://github.com/jdongkhan/jsontoentity","last_synced_at":"2025-04-15T07:20:09.080Z","repository":{"id":25890686,"uuid":"29331171","full_name":"JDongKhan/JsonToEntity","owner":"JDongKhan","description":"iOS端json转model，与别人不同的是：不是遍历model，而是遍历json来转换成model！","archived":false,"fork":false,"pushed_at":"2017-07-21T14:14:24.000Z","size":350,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T07:20:04.938Z","etag":null,"topics":["json","objective-c"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JDongKhan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-16T03:38:23.000Z","updated_at":"2023-03-09T04:45:05.000Z","dependencies_parsed_at":"2022-08-20T21:20:26.478Z","dependency_job_id":null,"html_url":"https://github.com/JDongKhan/JsonToEntity","commit_stats":null,"previous_names":["wangjindong/jsontoentity"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDongKhan%2FJsonToEntity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDongKhan%2FJsonToEntity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDongKhan%2FJsonToEntity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDongKhan%2FJsonToEntity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JDongKhan","download_url":"https://codeload.github.com/JDongKhan/JsonToEntity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023907,"owners_count":21199989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","objective-c"],"created_at":"2024-11-16T11:10:35.449Z","updated_at":"2025-04-15T07:20:09.060Z","avatar_url":"https://github.com/JDongKhan.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JsonToEntity\n\n超级简单的json转Model 核心代码就10来行，支持异步,支持coreData,使用时一个方法搞定(objectWithData:),喜欢用自己能看得懂的代码人的最爱，超级简单，入门就能看懂，如果你有好的建议请联系我:419591321@qq.com\n\n简单使用 pod 'JsonToEntity' '1.0.0'\n\n例子\n一、\n--------------------------------\n```c\nNSDictionary *dic = @{\n    @\"id\":@\"1234\",\n    @\"name\":@\"金融\"\n};\n\nDept *dept = [Dept objectWithData:dic];\nNSLog(@\"%@\",dept.name);\n```\n二、\n--------------------------------\n```c\nNSDictionary *dic = @{\n    @\"id\":@\"123\",\n    @\"name\":@\"wjd\",\n    @\"isRegister\":@1,\n    @\"sex\":@\"0\",\n    @\"dept\":@{\n        @\"name\":@\"金融\"\n    }\n};\n\nUser *user = [User objectWithData:dic];\nNSLog(@\"id:%d,sex:%@,name:%@ ,isRegister:%d, deptName:%@\",user.ID,user.sexString,user.name,user.isRegister,user.dept.name);\n```\n三、\n--------------------------------\n```c\nNSDictionary *dic = @{\n    @\"compayName\":@\"hs\",\n    @\"userArray\":@[\n        @{@\"name\":@\"wjd1\",@\"sex\":@\"0\",@\"dept\":@{@\"name\":@\"通信\"}},\n        @{@\"name\":@\"wjd2\",@\"sex\":@\"1\",@\"dept\":@{@\"name\":@\"金融\"}},\n        @{@\"name\":@\"wjd3\",@\"sex\":@\"0\",@\"dept\":@{@\"name\":@\"通信\"}},\n        @{@\"name\":@\"wjd4\",@\"sex\":@\"1\",@\"dept\":@{@\"name\":@\"时光飞逝\"}}\n    ]\n};\n\nCompay *compay = [Compay objectWithData:dic];\nUser *user = compay.userArray[0];\n\nNSLog(@\"copmayName:%@,第一个用户信息：name-%@,sex-%@,deptname:%@\",compay.compayName,user.name,user.sexString,user.dept.name);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdongkhan%2Fjsontoentity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdongkhan%2Fjsontoentity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdongkhan%2Fjsontoentity/lists"}