Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7037047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:29:48+00:00 2026-05-28T01:29:48+00:00

Possible Duplicate: change image on click of button in objective c i draged 3

  • 0

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 !!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:29:48+00:00Added an answer on May 28, 2026 at 1:29 am

    As Ankit explian you this can done in multi ways

    I suppose you have created two button add_btn, requestBtn with 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_btn connected to AddFriends methods and requestBtn with getFriendRequest.

    Now you can change the Image of Button As

    #pragma mark change Image of first Button
    -(void)AddFriends:(UIButton*)sender{       
        [add_btn setImage:[UIImage imageNamed:@"Cliked1.png"] forState:UIControlStateNormal];
        [requestBtn setImage:[UIImage imageNamed:@"unCliked2.png"] forState:UIControlStateNormal]; 
    }
    
    #pragma mark change Image of second Button
    -(void)getFriendRequest:(UIButton*)sender{
        [add_btn setImage:[UIImage imageNamed:@"unCliked1.png"] forState:UIControlStateNormal];
        [requestBtn setImage:[UIImage imageNamed:@"Cliked2.png"] forState:UIControlStateNormal];
    }
    

    I hope it will help you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to change database settings for a deployed war file? OK I
Possible Duplicate: How to change button text for Yes & No buttons on MessageBox.Show
Possible Duplicate: How to change the href for a hyperlink using jQuery I have
Possible Duplicate: How to change the href for a hyperlink using jQuery I have
Possible Duplicate: Can I change a private readonly field in C# using reflection? I
Possible Duplicate: How to change tooltip text for google chart api? I am using
Possible Duplicate: jQuery change input type How to replace input[type=submit] to input[type=text] using jQuery?
Possible Duplicate: Javascript change div content upon a click What I'm trying to do
Possible Duplicate: Can we change the device time using an application? is that possible
Possible Duplicate: Change CSS Dynamically I need to change the height of a div

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.