{"action":"closed","issue":{"url":"https://api.github.com/repos/ITEC-ELWG/iOS-Study/issues/7","labels_url":"https://api.github.com/repos/ITEC-ELWG/iOS-Study/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/ITEC-ELWG/iOS-Study/issues/7/comments","events_url":"https://api.github.com/repos/ITEC-ELWG/iOS-Study/issues/7/events","html_url":"https://github.com/ITEC-ELWG/iOS-Study/issues/7","id":117295520,"number":7,"title":"曾祥意-iOS-Task1-反馈2","user":{"login":"zekunyan","id":5687881,"avatar_url":"https://avatars.githubusercontent.com/u/5687881?v=3","gravatar_id":"","url":"https://api.github.com/users/zekunyan","html_url":"https://github.com/zekunyan","followers_url":"https://api.github.com/users/zekunyan/followers","following_url":"https://api.github.com/users/zekunyan/following{/other_user}","gists_url":"https://api.github.com/users/zekunyan/gists{/gist_id}","starred_url":"https://api.github.com/users/zekunyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zekunyan/subscriptions","organizations_url":"https://api.github.com/users/zekunyan/orgs","repos_url":"https://api.github.com/users/zekunyan/repos","events_url":"https://api.github.com/users/zekunyan/events{/privacy}","received_events_url":"https://api.github.com/users/zekunyan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-17T06:56:01Z","updated_at":"2015-11-28T09:22:49Z","closed_at":"2015-11-28T09:22:49Z","body":"## 提交规范\r\n* 居然没有`.gitignore`文件！这个必须有！\r\n* .DS_Store文件不能提交，检查git是否安装到位，Mac的话默认是会有全局的gitignore来处理这个的。\r\n* xcuserdata文件夹也不能提交，自己查找规范的gitignore写法。\r\n\r\n## 代码规范\r\n* 没有设置Class Prefix，这个是什么、怎么设置上网查。\r\n* 要善用`#pragma mark - `组织代码，现在的代码很乱。\r\n* 数据库操作完全跟界面、业务裹在一起，没有做模块化、没有抽离，在几面之间传递数据库实例，这个非常错误。\r\n* 没有善用常量，如数据库的列名、表名等，这些都应该是常量。\r\n* 代码风格完全不统一，如大括号的位置、空格，寿寿的培训白练了。\r\n* 要善于利用空行组织代码，函数之间空行保持一致，各种操作要合理分布。\r\n\r\n## 程序\r\n* `ItemViewController`里面的`IBOutlet`用错了，`IBOutlet `是为了跟Xib、StoryBoard链接的，自定义的View不用这个。\r\n* `footerView`的getter方法完全用错了，从Nib文件载入没有保存，这样每次调用`footerView`都会重新创建。\r\n* 所有的属性一律用`@property`定义。\r\n* iOS里面操作Sqlite最好用FMDB库，自己写会有很多问题，如并发、阻塞等。\r\n* 在主线程操作数据库，这个犯了大忌，会导致界面卡顿。\r\n* `initWithStyle`写法错误，Objective-C的init系列方法有严格的写法定义。\r\n* 已经`registerClass`过cell的类以后，在`cellForRowAtIndexPath`里面不用再判断cell是否为空，自己去查看标准的UITableView的用法。\r\n* `pushViewController`在新的viewController初始化、设置完成以后才调用。\r\n* `static`内部静态变量的初始化有严格的写法，要用dispatch_once写。\r\n* `NSDateFormatter`类的创建非常耗时，尽量只创建一次，并且延时创建。\r\n* 直接用Array管理列表数据，`ItemStore`类感觉没有必要。"}}