Possible Duplicate:
change image on click of button in objective c
i draged 3 button in my .xib file and initially i given default image to them using property window as first.png.
i don’t know name of my buttons, because i created button by dragging, i want to know what will be the name of my button ?
now when user clicks on firstButton, image of button should change from first.png to second.png..
and when user selects on 2nd button, image of button2 should change from first.png to second.png, and also change image of 1st button to default again first.png, so that user came to know he has clicked 2nd button.
in short i want to implement like radio button.
how should i do this ?
Thanks In Advance !!
As Ankit explian you this can done in multi ways
I suppose you have created two button
add_btn,requestBtnwith Interface Builder.Now you need to set the connection (Event, outlet) for both button.
I think you have knowledge so, I will not explain here how to set button (control) connection (Event, outlet) via inteface builder.
For example:
add_btnconnected toAddFriendsmethods andrequestBtnwithgetFriendRequest.Now you can change the Image of Button As
I hope it will help you