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

  • SEARCH
  • Home
  • 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 8253557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:55:05+00:00 2026-06-08T00:55:05+00:00

How can I reference by code a button’s tag value which I assigned earlier?

  • 0

How can I reference by code a button’s tag value which I assigned earlier?

What I’m trying to do is create a list in a table view that has checkbox images in each row. I only want one to be selected at a time within each section, so once one is selected, I would loop through the other buttons to unselect the others.

Below is the code how I assign each button in cellForRowAtIndexPath:

UIButton *addCheckButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
addCheckButton.frame = CGRectMake(self.view.frame.size.width - 40.0f, 5.0f, 32.0f, 32.0f);  
[addCheckButton setBackgroundImage:[UIImage imageNamed:@"checkbox_empty.png"]
                        forState:UIControlStateNormal];
[addCheckButton setBackgroundImage:[UIImage imageNamed:@"checkbox_full.png"]
                        forState:UIControlStateSelected];
[cell addSubview:addCheckButton];
[addCheckButton addTarget:self action:@selector(changeCheckState:) forControlEvents:UIControlEventTouchUpInside];
addCheckButton.tag = ([indexPath section] + 1) * 100 + [indexPath row];

I then can strip out the section and row of the selected button in my table view in the changeCheckState IBAction.

But I would also like something that I can say “Deselect buttons with tag 101, 102 and 103” within changeCheckState.

  • 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-06-08T00:55:06+00:00Added an answer on June 8, 2026 at 12:55 am
    id my101Button = [view viewWithTag:101];
    

    This question is one of those that are googled in seconds.

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

Sidebar

Related Questions

i can reference link with specific id with following code $(document).ready(function(){ $(a#example_link_id).click(function(event){ var url
Can you pass by reference with R ? for example, in the following code:
Can someone check my .NET code that I have in an InfoPath button to
I'm trying to create a custom tweet button with a popup, this part works.
With reference to the below mentioned code block (Designer- .ASPX), I am trying here
I am trying to use AddThis button on a web page of mine, which
hi i am trying to make an application which can submit a comment to
I noted there is a link to generate like button code at : http://developers.facebook.com/docs/reference/plugins/like/
can some on help me on how i can reference images i have all
is there a method to link specific files so that I can reference them

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.