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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:08:22+00:00 2026-05-28T02:08:22+00:00

I create a project of the Multiple user can tapped on the different button.

  • 0

I create a project of the Multiple user can tapped on the different button.

Following problem may phase,
I implement the gestureRecognizer and it’s proper work but how get the which button tapped by the user for that to access those button event’s

following screen shows the button,

enter image description here
Following is the code for gestureRecognizer delegate method so, how to get the button event and how to manage it,

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{

    if ([touch.view isKindOfClass:[UIButton class]]) {
        NSLog(@"Button is pressed");
        if (tag == 1) {
            NSLog(@"Button1 is pressed");
        }
        return NO;
    }
    return YES;
}

following method for the IBAction method to touch when the button tapped

-(IBAction)btnPress:(id)sender{
    tag=[sender tag];
    NSLog(@"%i",tag);
}

But here issue is first call the gestureRecognizer delegate method then IBAction method to how to solve this problem,

Thanks in advance for your valuable time spend on my problem,

Thaks and regards
Neon Samuel.

  • 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-28T02:08:23+00:00Added an answer on May 28, 2026 at 2:08 am

    If the button is instance of UIButton, then you do not need to use gestureRecognizer at all.
    Try to set addTarget:action to get callback when user click that UIButton:

    [button1 addTarget:self action:@selector(btnPress:)];
    [button2 addTarget:self action:@selector(btnPress:)];
    

    If you have already set tag value to each button, then your IBAction method would work properly.

    -(IBAction)btnPress:(id)sender{
    NSInteger tag=[sender tag];
    NSLog(@"%d",tag);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'll start by quoting google's blog Project owners can now create multiple repositories for
I am working a project currently in which the user can add multiple news
I have a project where the user can add multiple files to a cart
I'm trying to learn how to use lift. I can create project skeleton by
I can't create New Project on my Visual Web Developer 2008 Express with SP1.
A user can create an object, and he has followers that I want to
I create multiple Frame programmatically and navigate each Frame to different page, But all
Currently we are running multiple Sitecore projects. Whenever the projects go live we create
For a company with many development projects, should you create multiple FitNesse wikis (one
In ZF you create a project by running this command: zf create project MyProjectName

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.