Key Commands must all have a Title, Key and Selector

巧了我就是萌 提交于 2019-12-01 03:09:59

Open your storyboard file as source code (right click -> open as -> source code). There should be a line, <keyCommands> <keyCommand/> </keyCommands>. Removing this should solve your problem.

This line can be caused by accidentally clicking the + button in the key commands section of the view controller's attributes inspector, although it may be caused by other factors. The extra line can cause weird things to happen in XCode, such as errors and crashes.

Himanshu

I have a solution:

  1. Open storyboard as "source Code" (right click on storyboard -> open as -> source code).
  2. Delete this line: <keyCommands><keyCommand/></keyCommands>
  3. Run app.

To do this with the xcode interface builder:

  1. Select your view controller

  2. Select attributes inspector

  3. Find "Key Commands" list at the bottom

  4. Select the keys within the list, such as: "Enter action below"

  5. Hit the minus button

This should fix the problem.

Example Image, Click Here

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!