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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:25:10+00:00 2026-05-12T12:25:10+00:00

I have 4 button (b1,b2,b3,b4) and a label (lab).Now I want to display button

  • 0

I have 4 button (b1,b2,b3,b4) and a label (lab).Now I want to display button title in label when a particular button is pressed.i did it with four (IBAction) method one for every button.But i want to do it with 1(IBAction) method.so the problem is to to how to identify which button is pressed??? i knew a method something like “getBytitle” method.But i need better solution.Can anyone help??? I also need answer about how to identify button in segment control.Advanced thanx for reply.

  • 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-12T12:25:11+00:00Added an answer on May 12, 2026 at 12:25 pm

    Have a look in IB, the tag field of the button attibutes might be what you are looking for. Set each of the buttons you want to detect with a different integer tag value, and then set their IBActions to the same method. Now you can check which button was pressed by checking for the tag field in the sender

    - (IBAction) buttonPressed: (id) sender
    {
        switch ( ((UIButton*)sender).tag ){
    
           case 1:
                   <something>
                   break;
           case 2:
                   <something else>
                   break;
    
           default:
                   <default something>
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three button named(titled) hello, nothing, heaven and one label (IBOutlet UIlabel lab).
I have a button, the label of which I want to change back and
This is my problem, I have one textbox, one button and one label. Everything
I have a user control that contains multiple controls (CheckBox, Button, Label...). I want
I have a button and a label. on clicking on that button i want
i have a label and button inside update panel, when i try to get
I have a Windows Form application with a button named loginBtn and a label
I have a simple metro app contains a button, a label and a drop
When I have many controls on a Form (i.e. Label, Button etc) that do
I want to change the button label on the installers welcome page, that says

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.