MultipleControllers in one view

余生颓废 提交于 2019-12-02 11:42:21

The IBActions typically take an input parameter of type id. So your buttonPressed action should look like

-(IBAction)buttonPressed:(id)sender;

When this action is actually called, a reference to the control which calls it (in this case the button) is passed.

When calling it programatically, you can send the controller's object (self) to it.

Without seeing the code it is tough to say exactly what the problem is. That said, it is most definitely a target-action related problem. When the button is clicked, it sends its target an action message. Whatever target you have assigned your button does not respond to the action you are trying to send to it.

Perhaps you didn't implement the action on the target you desire? Perhaps you entered the wrong target or action name by mistake (or connected them incorrectly in interface builder)?

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