cannot connect UIbutton to interface in xcode3
I added a uibutton to the interface but when trying to connect it to the Controll开发者_高级运维er class, ctrl+dragging to the interface block does nothing. The line simply vanishes, and no connection is made. what is going wrong here?
You should be connecting the IBAction to the UIButton. When you drag the IBAction connection to the button it should ask you what kind of connection you want to make. I usually choose "touch up inside".
In the connections tab of IB the IBAction should be listed as changeGreeting:
swami did you give the action method in the .h file? Try declaring the method in .h and its implementation in .m and also make sure that you define the button name in .h file ex: IBOutlet UIButton buttonName; save it and try doing it by assigning action as touchupinside or any else it should work.
hope it helps you.
精彩评论