{"id":22065084,"url":"https://github.com/wilddylan/restdemo","last_synced_at":"2025-03-23T18:15:16.948Z","repository":{"id":84799615,"uuid":"37463049","full_name":"wilddylan/RestDemo","owner":"wilddylan","description":"RestDemo And OHHTTPStubs Demo And a Normal progress View","archived":false,"fork":false,"pushed_at":"2015-06-18T01:32:22.000Z","size":873,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T00:25:00.030Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wilddylan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-15T12:14:21.000Z","updated_at":"2017-09-04T03:22:18.000Z","dependencies_parsed_at":"2023-03-02T13:45:50.008Z","dependency_job_id":null,"html_url":"https://github.com/wilddylan/RestDemo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilddylan%2FRestDemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilddylan%2FRestDemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilddylan%2FRestDemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilddylan%2FRestDemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wilddylan","download_url":"https://codeload.github.com/wilddylan/RestDemo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245144972,"owners_count":20568056,"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":[],"created_at":"2024-11-30T19:14:58.430Z","updated_at":"2025-03-23T18:15:16.922Z","avatar_url":"https://github.com/wilddylan.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RestDemo\nRestDemo And OHHTTPStubs Demo And a Normal progress View\n好久没有更新文章了, 抱歉拖更、今天带大家熟悉一些新的东西。\n\n工程中使用了标题中的这些东西`RestKit（Rest请求, Mapping对象, 项目中包含了写入到CoreData以及普通对象获取）`, `OHHTTPStubs（在离线条件下模拟网络请求, 也可以在程序没网的时候用作离线数据的提供）`,`CDZPinger（Ping工具, 最近项目要使用socket.io 所以顺便拿来看一下, 岁simplePing的上层封装）`,`CocoaLumberjack（常用的Log工具DDLog）`, 另外还有用作进度框的`M13ProgressSuite（不错的进度条, 大家看界面就行）`.实现了RestKit请求到数据直接存储到CoreData与Get本地对象2个简单的功能\n\n\n![屏幕快照 2015-06-15 下午8.07.24.png](http://upload-images.jianshu.io/upload_images/144590-656fed3ac0c4642d.png)\n\n项目环境: x-code 6.3.2 Objective-c （x-code7. 还是有很多坑的, 大家慎重使用, 请期待稳定版本。OSX10.11 同样有很多的BUG）。\n\npod File: \n\n```json\npod 'RestKit'\npod 'OHHTTPStubs'\npod 'CocoaLumberjack'\npod 'M13ProgressSuite'\npod 'CDZPinger'\npod 'MagicalRecord'\n\n```\n\n![屏幕快照 2015-06-15 下午8.00.13.png](http://upload-images.jianshu.io/upload_images/144590-d394361559ea8d66.png)\n\n文件很少 大致说一下功能：\nSources： json文件, sources文件存放, OHHTTPStubs模拟网络响应的资源\nBasement： 公共的头文件, Map以及HttpServer的2个工具类\nAppDelegate： \nModel： 模型（包括CoreData生成的模型以及自己创建的模型）\nViewController : 界面 简单的测试。\n\n步骤1：基本的配置, 包括模拟网络响应的配置以及RestKit对对象的Mapping\n\n在AppDelegate中调用Basement中Map, HTTPServer的方法, 并且打开Log\n\n\n![屏幕快照 2015-06-15 下午8.08.46.png](http://upload-images.jianshu.io/upload_images/144590-dcb442426238bd51.png)\n\nMap-Student CoreData描述:\n\n![屏幕快照 2015-06-15 下午8.09.15.png](http://upload-images.jianshu.io/upload_images/144590-8bb64044e5c106f1.png)\n\nMap-Car 对象\n\n\n![屏幕快照 2015-06-15 下午8.09.24.png](http://upload-images.jianshu.io/upload_images/144590-1095617d74dcfb9f.png)\n\nHTTPServer-创建请求截获并写出响应\n\n\n![屏幕快照 2015-06-15 下午8.10.51.png](http://upload-images.jianshu.io/upload_images/144590-23ef357b23b30a33.png)\n\n请求Car对象\n\n\n![屏幕快照 2015-06-15 下午8.11.23.png](http://upload-images.jianshu.io/upload_images/144590-b664e163f14343e0.png)\n\n\n我把项目的源码放到GitHub上边 这是一个很好的Demo来学习Rest以及断网处理的OHHTTPStubs， 希望大家会喜欢。并且, 我会在此基础上慢慢增加一些别的东西进来比如说Canvas Pop Shimmer ReactCocoa等新鲜的东西来丰富大家的知识。  喜欢请关注。\n\n源码地址: [Git Hub Page](https://github.com/WildDylan/RestDemo)\n\nCopyRight @WildDylan. 2015-6-15 \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilddylan%2Frestdemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilddylan%2Frestdemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilddylan%2Frestdemo/lists"}