{"action":"reopened","issue":{"url":"https://api.github.com/repos/LeslieZhu/MinYi/issues/2","labels_url":"https://api.github.com/repos/LeslieZhu/MinYi/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/LeslieZhu/MinYi/issues/2/comments","events_url":"https://api.github.com/repos/LeslieZhu/MinYi/issues/2/events","html_url":"https://github.com/LeslieZhu/MinYi/issues/2","id":96572666,"number":2,"title":"iOS学习遇到问题: this-class-is-not-key-value-coding-compliant-for-the-key-view","user":{"login":"LeslieZhu","id":2840435,"avatar_url":"https://avatars.githubusercontent.com/u/2840435?v=3","gravatar_id":"","url":"https://api.github.com/users/LeslieZhu","html_url":"https://github.com/LeslieZhu","followers_url":"https://api.github.com/users/LeslieZhu/followers","following_url":"https://api.github.com/users/LeslieZhu/following{/other_user}","gists_url":"https://api.github.com/users/LeslieZhu/gists{/gist_id}","starred_url":"https://api.github.com/users/LeslieZhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeslieZhu/subscriptions","organizations_url":"https://api.github.com/users/LeslieZhu/orgs","repos_url":"https://api.github.com/users/LeslieZhu/repos","events_url":"https://api.github.com/users/LeslieZhu/events{/privacy}","received_events_url":"https://api.github.com/users/LeslieZhu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/LeslieZhu/MinYi/labels/iOS","name":"iOS","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/LeslieZhu/MinYi/milestones/1","html_url":"https://github.com/LeslieZhu/MinYi/milestones/before%202015","labels_url":"https://api.github.com/repos/LeslieZhu/MinYi/milestones/1/labels","id":1434824,"number":1,"title":"before 2015","description":"在2015之前，一直通过 [敏毅](http://lesliezhu.github.com/) 来写博客，慢慢觉得还是`Issues`简单方便，就放到这里，但至今也没有写太多东西。\r\n\r\n现在，将2015年以前的做一个集合，同时以后通过`issues`准备做下列事情：\r\n\r\n- **翻译文章**：包括英文翻译、日文翻译、中文翻译等等，尽量而为\r\n- **技术博客**：平时学习、工作中遇到的问题，总结为笔记，保存下来\r\n- **长安遍地是黄金**： 一些鸡毛蒜皮的事情，放到这里来，做个记录\r\n- **图片**：将一些图片也发到`issues`里面，github会自动保存图片，空间不够的时候就再考虑付费\r\n\r\n什么博客日志，什么评论分享，我只是写给自己看。可可","creator":{"login":"LeslieZhu","id":2840435,"avatar_url":"https://avatars.githubusercontent.com/u/2840435?v=3","gravatar_id":"","url":"https://api.github.com/users/LeslieZhu","html_url":"https://github.com/LeslieZhu","followers_url":"https://api.github.com/users/LeslieZhu/followers","following_url":"https://api.github.com/users/LeslieZhu/following{/other_user}","gists_url":"https://api.github.com/users/LeslieZhu/gists{/gist_id}","starred_url":"https://api.github.com/users/LeslieZhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeslieZhu/subscriptions","organizations_url":"https://api.github.com/users/LeslieZhu/orgs","repos_url":"https://api.github.com/users/LeslieZhu/repos","events_url":"https://api.github.com/users/LeslieZhu/events{/privacy}","received_events_url":"https://api.github.com/users/LeslieZhu/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":4,"state":"open","created_at":"2015-11-30T09:31:15Z","updated_at":"2015-12-03T06:02:53Z","due_on":"2015-12-30T16:00:00Z","closed_at":null},"comments":0,"created_at":"2015-07-22T13:47:32Z","updated_at":"2015-12-03T06:02:53Z","closed_at":null,"body":"# this-class-is-not-key-value-coding-compliant-for-the-key-view\r\n\r\n\r\n今天照着书本学习iOS过程遇到一个问题，记录如下。\r\n\r\n## 问题产生的原因\r\n\r\n由于书籍里面的内容和最新的XCode内容有点差别，在XCode新建的 **single application view** 里面，默认有一个 **Launch Screen File** 和一个 **Storyboard** 文件，而在书本里面将的例子里面只有一个XIB文件。\r\n\r\n为了保持统一，我就删掉了Launch Screen和Storyboard文件，自行添加了一个XIB文件，同时在 **TARGETS->Main Interface** 设置为该XIB文件(之前我一直这样干)。\r\n\r\n这样，一运行就报错:\r\n\r\n```\r\nthis class is not key value coding-compliant for the key view.\r\n```\r\n\r\n自己查了点资料，有说是 **File's Owner** 的 **Custom Class** 设置不对的，又说绑定的 **Outlet** 不对的，反正各种情况都尝试了还是不解决问题。\r\n\r\n## 问题的解决\r\n\r\nhttp://stackoverflow.com/questions/10152872/this-class-is-not-key-value-coding-compliant-for-the-key-view\r\n\r\n**@Joseph DeCarlo**:\r\n\r\n```\r\nIf you have a control in your nib (xib file) that is linked to a property (IBOutlet) or method (IBAction) in your view controller, and you have either deleted or renamed the property or method, the runtime can't find it because it has been renamed and therefore crashes.\r\n\r\nIn your case, you have set the Main Interface property of the project to your ViewController.nib. This is a problem because the only nibs that should be used as Main Interface should have UIWindows in them and the File Owner in that nib should be set to the AppDelegate. The UIWindow in the nib should be linked to the File Owner's (AppDelegate) window property. Because you set that with a nib without the traits the runtime was looking for, it gives you this error.\r\n\r\nThe solution is to leave the Main Interface blank as you do not have to set up UIWindows manually anymore.\r\n```\r\n\r\n将Main Interface的设置留空就不存在这个问题了，一个小问题花费了我不少时间，一直摸不着头脑.\r\n\r\n\r\n## 资料\r\n\r\n- http://stackoverflow.com/questions/10152872/this-class-is-not-key-value-coding-compliant-for-the-key-view/"}}