When I follow the instructions at How do I add an action or outlet to a class in Xcode 4.3.1?, or Apple's First iOS App tutorial, there's no option for Action. There is only options for Outlet and Outlet Connections. What am I doing wrong?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can connect actions only to subclasses of UIControl
.
You are trying to create an action from a UIView
, which is not a subclass of UIControl and does not have actions.
Start the drag from the button, and not the "main view"