I have 4 button (b1,b2,b3,b4) and a label (lab).Now I want to display button title in label when a particular button is pressed.i did it with four (IBAction) method one for every button.But i want to do it with 1(IBAction) method.so the problem is to to how to identify which button is pressed??? i knew a method something like “getBytitle” method.But i need better solution.Can anyone help??? I also need answer about how to identify button in segment control.Advanced thanx for reply.
Share
Have a look in IB, the tag field of the button attibutes might be what you are looking for. Set each of the buttons you want to detect with a different integer tag value, and then set their IBActions to the same method. Now you can check which button was pressed by checking for the tag field in the sender