I have 2 button objects (UIButton *obtn,*ebtn), I have created 12 buttons(6 buttons with 6 tag values for obtn, 6 buttons with 6 tag values for ebtn)… I have a single btnClick: method for all those 12 buttons… when i click on a button of tag value 1… Iam getting the properties of selected button to another button by using sender… I want to get the properties of unselected button (Example obtn object with tag value 3) into another button How can i get it…?
My Direct Question is: How to assign the properties of a button with a tag value to another button when it is in unselected state…
It sounds like you want to be able to get a pointer to a button with a certain tag, and at the moment all you can do is get the button that has sent you the action.
The method you are looking for is
viewWithTag:. This will get you a button (or any other view) with the tag you want. You pass this method to the superview of the button. So, in your action method (assuming all buttons are in the same superview):You then have
sender, which is the button that was tapped, andotherButton, which is the button with tag 3. You can modify each one as you wish.