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 6543107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:18:25+00:00 2026-05-25T11:18:25+00:00

I have created a UIbutton inside a UITableView . I have multiple rows. On

  • 0

I have created a UIbutton inside a UITableView. I have multiple rows. On touching the button of a particular row I want the image of that particular button to change. The button I am adding is a checkbox. So every time I touch the button, its image will change.

Here is my code:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {  

/*  

Some code  

*/  

 //Checkbox
        UIImage *buttonImage = [UIImage imageNamed:@"arrow-not-checked.png"];
        btnConfirm = [UIButton buttonWithType:UIButtonTypeCustom];
        btnConfirm.tag =[[arrID objectAtIndex:indexPath.row] intValue]; 
        [btnConfirm setImage:buttonImage forState:UIControlStateNormal];
        btnConfirm.frame = CGRectMake(checkboxXX, 10.0, buttonImage.size.width, buttonImage.size.height);
        [btnConfirm addTarget:self action:@selector(AddToCart:) forControlEvents:UIControlEventTouchUpInside];
        [cell.contentView addSubview:btnConfirm];  

}  



-(void)AddToCart:(id)sender
{
    UIButton *btnTemp=sender;
    int iTag = btnTemp.tag;  

    // I want to change image of sender

}  
  • 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-25T11:18:26+00:00Added an answer on May 25, 2026 at 11:18 am
    -(void)AddToCart:(id)sender
    
    {
    UIButton *btnTemp = (UIButton *)sender;
    int iTag = btnTemp.tag;  
    
    // I want to change image of sender
    [btnTemp setImage:yourImage forState:UIControlStateNormal];
    
    }  
    

    Try this. Hope this helps.

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

Sidebar

Related Questions

I have a UIButton that is created inside of each table cell. I want
I have created a PHP-script to update a web server that is live inside
I have created a custom UIButton (UIButton subclass) for my application. Within this button's
I have created a button programmatically and I want to fire event to go
I have created a custom button called ModuleUIButton which inherits from UIButton . This
I have a button that's created via a NIB file. I've derived a class
I have UIButton that I set the background image for three states, normal, highlighted,
I have created a custom UIView that I would like to use on multiple
I have successfully created a UITableView/UITableViewCell that is able to slide up and down
This way i have created my custom button and set the image.I have set

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.