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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:50:21+00:00 2026-05-23T22:50:21+00:00

I have an UIButton array like this: @property (nonatomic, retain) IBOutletCollection(UIButton) NSArray *btn_Impact_Collection; and

  • 0

I have an UIButton array like this:

@property (nonatomic, retain) IBOutletCollection(UIButton) NSArray *btn_Impact_Collection;

and I have this function:

- (IBAction)impactAction:(id)sender;

In the XIB file I have nine button, each button is connected to btn_Impact_Collection Array with the Referencing Outlet Collection. Moreover the Touch_inside property of each button is connected to the function ImpactAction.

Now, when a button is clicked the ImpactAction function is called, but inside this function, how can i know which button is pressed?

Thanks in advance for the answer!

  • 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-23T22:50:22+00:00Added an answer on May 23, 2026 at 10:50 pm

    Cast sender to UIButton class, and that will give you the instance of the clicked button. I don’t have Xcode with me but something like:

    if ([sender isMemberOfClass:[UIButton class]])
    {
        UIButton *btn = (UIButton *)sender;
    
        // Then you can reference the title or a tag of the clicked button to do some further conditional logic if you want.
        if([btn.currentTitle isEqualToString:@"title of button"])
        {
            // do something.
        }
        else if(etc...)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIButton array. UIButton *btn[12]; I want to set property for this
I have a: @property(nonatomic, retain) NSArray * buttonsArray; ... ... @synthesize buttonsArray; when the
I have a setup like this... $(document).ready(function(){ var model = { /* some variable
I have an NSMutableArray property defined in my Brain model. @property (retain, nonatomic) NSMutableArray
I have a UIButton, and I'd like to update its title, but I'd rather
I have a method that accepts a sender and is called with a UIbutton.
I have a UIButton, and I'm adding an image to it using this code:
I have created a custom button called ModuleUIButton which inherits from UIButton . This
I want to add an automatic favorites feature that works like this: I have
I have this code for creating an array of images to display on a

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.