Swift ViewController does not respond to -getFile, Could not connect action, target class

只愿长相守 提交于 2020-01-17 06:06:28

问题


My code works all fine but there is always two console message every time I run it. app works fine but the messages just bugs me so much. Could anyone tell me what is wrong with my code and what does these console message means,thanks

2016-06-13 14:31:15.014 
LazyHackintoshGenerator[1625:37250] Could not connect action, target class 
LazyHackintoshGenerator.ViewController does not respond to -getFile:

回答1:


Likely a control's action in your storyboard is linked to a method getfile that no longer exists




回答2:


  1. Select your ViewController.
  2. Right-click on its “View Controller” icon (the blue circle with a white square inside).
  3. Look for warning icons (yellow triangles).
  4. Hover over them. An explanation of the problem will appear. As Feldur said, the problem is probably a leftover link from your storyboard to a method that does not exist anymore (maybe you renamed it or deleted it manually). Remove the link by clicking on the cross, and, if needed, re-link to the appropriate method in your code.

Here is an example of what it will look like in Interface Builder.



来源:https://stackoverflow.com/questions/37783259/swift-viewcontroller-does-not-respond-to-getfile-could-not-connect-action-tar

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